Beginners Guide to Unit Testing with NUnit and C#

Learn the basics of unit testing with NUnit and C#.
Rating: 4.3 out of 5 (517 ratings)
14,946 students
Beginners Guide to Unit Testing with NUnit and C#
Rating: 4.3 out of 5 (518 ratings)
14,946 students
Write simple unit tests in C# using the NUnit framework

Requirements

  • Basic Skills in C#
Description

This course is all about writing unit tests using C# programming language and NUnit as a unit testing framework. Today unit testing is an absolutely required skill from any professional developer. Companies expect from developers to know how to write unit tests.

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.

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
Who this course is for:
  • Anyone who wants to learn the basic of unit testing
Course content
2 sections • 33 lectures • 1h 52m total length
  • About the Course
    00:27
  • Download Source Code and Slides
    00:04
  • BONUS
    00:35
  • Outline
    00:58
  • What is a Unit Test?
    03:11
  • Unit-Testing Frameworks
    03:25
  • First Unit Test
    08:49
  • Naming Conventions
    04:34
  • Running and Debugging Tests in Visual Studio
    05:02
  • Benefits of Unit Testing
    03:35
  • Who should write unit tests and When?
    02:51
  • Programmer's Oath
    03:29
  • Exercise: Degree Converter
    01:29
  • Solution: Degree Converter
    06:54
  • Conclusion
    01:15
  • Outline
    01:06
  • Assert. Introduction
    05:29
  • Assert. Demo
    10:27
  • Arrange-Act-Assert (AAA)
    01:01
  • Running a Test from the Console
    01:51
  • SetUp and TearDown
    05:09
  • SetUp and TearDown on Higher Levels
    02:13
  • Parameterized Tests
    03:40
  • Grouping and Ignoring
    02:14
  • Code Coverage
    01:42
  • Exercise: FizzBuzz
    01:07
  • Solution: FizzBuzz
    05:05
  • Exercise: Roman Numerals
    02:27
  • Solution: Roman Numerals
    09:27
  • Exercise: Stack
    00:59
  • Solution: Stack
    09:02
  • Conclusion
    01:24
  • BONUS-Video
    01:18

Instructor
Software Engineer - 1000+ Reviews, Average Score - 4.5
Engineer Spock
  • 4.2 Instructor Rating
  • 6,538 Reviews
  • 55,262 Students
  • 22 Courses

I'm thankful enough for that I love what I do.

I began my career as a postgraduate student participating in Microsoft ImagineCup contest.

I've been working with .NET platform since 2003. I've been professionally architecting and implementing software for nearly 7 years, primarily based on .NET platform. I'm passionate about building rich and powerful applications using modern technologies. I'm a certified specialist in Windows Applications and Service Communication Applications by Microsoft. I'm one of the coordinators of the MSK.NET User Group in Moscow.

"If it's work, we try to do less. If it's art, we try to do more." - Seth Godin.

What I can say is that software is my art.