Course Promo: Learn Unit Testing in C# with NUnit

Поділитися
Вставка
  • Опубліковано 9 чер 2024
  • View full course just for 10.99$: bit.ly/2nbJjTR
    Learn deeply the concepts and tools that you will need to build maintainable and reliable software.
    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 basic features
    Test Doubles including fakes, dummies, stubs, spies and mocks
    How to write manual test doubles and how to use a mocking framework
    TDD, red-green-refactor triplet
    A great number of best practices of writing unit tests

КОМЕНТАРІ •