Learn Unit Testing with NUnit and C#

Learn unit testing, TDD, mocking and Dependency Injection: techniques that you'll need to build reliable software.

4.35 (1645 reviews)
Udemy
platform
English
language
Software Engineering
category
instructor
Learn Unit Testing with NUnit and C#
8,352
students
7.5 hours
content
Jul 2020
last update
$74.99
regular price

What you will learn

Write Unit Tests

Run and Debug Unit Tests

Write Manual Mocks

Write Mocks with Mocking Framework

Practice Test-Driven Development (TDD)

Apply Best Practices of Writing Unit Tests

Why take this course?

Learn deeply the concepts and tools that you will need to build maintainable and reliable software.

Teaching Approach

No fluff, no ranting, no beating the air. I respect your time. The course material is succinct, yet comprehensive. All important concepts are covered. Particularly important topics are covered in-depth.

Take this course, and you will be satisfied.   

Build a solid foundation in Unit Testing with this course   

This course is all about writing effective unit tests using C# programming language and NUnit as a unit testing framework. Along the way, we will learn the concepts related to unit testing. Today unit testing is an absolutely required skill from any professional developer. Companies expect from developers to know how to write unit tests including all the most important topics such as mocking and test driven development (TDD in short). This course does not cover all the features of NUnit. This course is way more interesting.   

Learning unit testing puts a powerful and very useful tool at your fingertips. Being familiar with unit testing you can write reliable and maintainable applications. It is very hard to lead a project which is not covered by unit tests.   

Content and Overview   

This course is primarily aimed at beginner developers. It provides solid theoretical base reinforced by tons of practical material.   

We start with basics of unit testing. What is a unit test? What unit testing frameworks exist? How to run and debug unit tests. After getting acquainted with the basics, we will get to the NUnit framework. Here you’ll learn how to install the framework, set the runner. Then you’ll learn the basics of assertions and arrange-act-assert triplet. Other key features of NUnit are also covered:   

  • Running tests from the console   

  • Setup and teardown unit tests   

  • Parameterized tests   

  • Grouping and ignoring   

Practicing writing of unit tests, it’s impossible to avoid applying mocks. I like the word “test double” more, in general. By the way, you’ll learn what the difference between the following notion is:   

  • Test double   

  • Fake   

  • Dummy   

  • Stub   

  • Mock   

You’ll learn how to write test doubles manually. You will also see a simple example of how to use a mocking framework for using mocks. I’ll use NSubstitute mocking framework for demonstration.   

At the end of this section, you’ll get acquainted with two key approaches to unit testing, Classic or Detroit School and London School of unit testing.   

You’ll separately learn the basic of test-driven development. It is hard to imagine a modern professional developer who doesn’t know about TDD, so you’ll learn what it is and what it is about. You’ll see the Red-Green-Refactor triplet in action.   

I could not complete the course avoiding the best practices of writing unit tests. You’ll learn the basic concepts of the modern approach to unit testing called “pragmatic unit testing”. You’ll see what problems static classes and singletons bring regarding the unit testing. They make code harder to unit test. After that, you’ll learn the problem of extracting interfaces just for the sake of introducing shims for injecting dependencies.   

You’ll know should you write unit tests for the trivial code. You’ll learn a lot more in the course.   

So, in short, the course covers the following topics:   

  • Basic notions of Unit Testing   

  • NUnit and its features   

  • Test Doubles including fakes, dummies, stubs, spies and mocks   

  • How to write manual test doubles and how to use a mocking framework  (NSubstitute)

  • TDD, red-green-refactor triplet   

  • A great number of best practices of writing unit tests   

  • Introduction to Dependency Injection

In the end, we will recap what you have learned, and you will try to understand where you have to go further with the intention to master your skills.   

How long is this course: The course is around 7.5 hours. All are video lectures. You will be able to download all the slides and code samples used in the course.         

------------------------------------------------------------

Keywords related to the course:

  • Visual Studio unit testing tutorial

  • NUnit unit testing tutorial

  • Dot Net testing framework

  • C# unit test framework

  • Visual Studio unit testing framework tutorial

  • csharp unit testing tutorial   

  • TDD in C#

  • NSubstitute

  • TDD

  • Test Driven Development

  • unit testing C#

Screenshots

Learn Unit Testing with NUnit and C# - Screenshot_01Learn Unit Testing with NUnit and C# - Screenshot_02Learn Unit Testing with NUnit and C# - Screenshot_03Learn Unit Testing with NUnit and C# - Screenshot_04

Our review

🌟 **Overall Course Rating:** 4.32/5 **Recent Reviews Summary:** **Pros:** - The course is **valuable and well planned**, with content that is **concise yet complete**. (Reviewer 10) - It offers a **good balance of practical tips and background information**, helpful for quickly understanding fundamentals. (Reviewer 8) - The instructor is **expert in the material** and the course **accurate and well organized**. (Reviewer 9 & 11) - The explanation of steps for project setup is **clear**, providing a lot of material for learning. (Reviewer 12) - The course covers everything needed for unit testing, including a bonus topic on Dependency Injection (DI). (Reviewer 14) - It is **thorough**, leaving little to interpretation and includes subtitles to help with understanding. (Reviewer 16 & 17) - It is **good for preparing for TDD** and focuses on writing good test cases. (Reviewer 20) - The course is **clear and thorough**, with a nice touch on theory concepts. (Reviewer 23) **Cons:** - The **Visual Studio Setup** could be improved, as it doesn't provide a project base for beginners to start from. (Reviewer 1) - The course lacks more detailed explanations about unit tests, specifically regarding code examples and implementation. (Reviewers 1 & 6) - Some reviewers found the **presentation style** of the instructor a bit dry and slow, which can make it hard to stay focused. (Reviewer 9 & 21) - There are **errors in transcriptions** from English to the local language, causing some difficulties in understanding. (Reviewer 18) - The course has a **disappointing audio quality**, with the instructor reading from a prompt. (Reviewer 19) - Some reviewers found it confusing whether to use the provided project or start with their own, as there was no clear indication of how to proceed. (Reviewers 21 & 22) - Additional examples for testing mapped models (e.g., AutoMapper) and builders (e.g., NBuilder) would be beneficial. (Reviewer 20) - A few reviewers suggested that **code examples** could be more effective if written while being explained. (Reviewers 21 & 27) - It was noted that the course would benefit from having more complete example projects available for download. (Reviewer 26) **General Feedback:** The majority of reviewers found the course to be informative and useful, with a particular emphasis on the expertise of the instructor and the thoroughness of the content. However, there are areas where improvements could be made, such as in the presentation style, audio quality, and providing clearer instructions for beginners. The course's focus on unit testing and TDD is well received, but some reviewers expressed a desire for more integration test examples and additional practical resources like complete project examples for learners to practice with. Overall, the course is highly regarded as a valuable resource for those looking to understand and implement unit testing and associated practices.

Charts

Price

Learn Unit Testing with NUnit and C# - Price chart

Rating

Learn Unit Testing with NUnit and C# - Ratings chart

Enrollment distribution

Learn Unit Testing with NUnit and C# - Distribution chart

Related Topics

1152726
udemy ID
3/21/2017
course created date
10/17/2019
course indexed date
Bot
course submited by