Keep Calm and Study On - Unlock Your Success - Use #TOGETHER for 30% discount at Checkout

Unit Testing in .NET Core Online Course

Unit Testing in .NET Core Online Course


In production applications, even a small change can unintentionally disrupt other functionalities. With well-written unit tests, these issues can be prevented. This course focuses on teaching you the fundamentals of unit testing using C# and NUnit/xUnit frameworks. You'll gain hands-on experience writing effective unit tests and applying them to real-world projects. Unit testing has become an essential skill for professional developers, and this course helps you build a strong foundation using best practices. You’ll learn to implement unit testing in .NET Core web applications with EF Core, ensuring a thorough understanding of testing in modern development environments. By the end, you'll have the expertise to write robust unit tests and apply them to N-Tier web applications with .NET 6 and EF Core.


Key Benefits

  • This course offers a thorough, well-structured, and easy-to-understand approach to unit testing in .NET Core, ensuring that complex concepts are broken down into manageable lessons. 
  • It is delivered using the latest versions of .NET Core 6 and Visual Studio Code 2022, keeping you up-to-date with the most current technologies. 
  • Throughout the course, you will gain a deep understanding of the rationale behind various testing approaches, enabling you to make informed decisions about the most effective strategies for unit testing in .NET Core applications.


Target Audience

This course is for .NET developers aiming to enhance the quality of their software by minimizing bugs and improving overall reliability. It provides a comprehensive introduction to unit testing, starting from the basics and reinforcing core concepts through practical, real-world applications. To maximize the learning experience, a foundational understanding of C# along with .NET Core and EF Core is recommended. No prior experience with unit testing is required, as the course will guide you through the fundamentals and build your expertise step by step.


Learning Objectives

  • This course will teach you the fundamentals of unit testing, starting from the ground up. You will gain hands-on experience in setting up and utilizing the NUnit and xUnit testing frameworks. 
  • Additionally, you will learn how to write effective mocks using the Mocking Framework (MOQ). The course covers the essential principles of unit testing, including how to write, run, and debug unit tests. 
  • You will apply your knowledge by implementing unit testing in an N-tier real-world web application project using xUnit, providing practical, industry-relevant experience.

Course Outline

The Unit Testing in .NET Core Exam covers the following topics - 

Module 1 - Course Introduction

  • Overview of Manual Testing
  • Benefits of Automated Testing
  • Essential Tools for Testing
  • Types of Tests and Their Applications
  • The Testing Pyramid Concept
  • Logical Stages in Automated Testing


Module 2 - First Unit Test

  • .NET 6 Update: Nullable Types
  • Project Creation and Setup
  • Creating an MSTest Project
  • Writing the First Unit Test
  • Example of a Failed Test


Module 3 - Unit Testing Fundamentals

  • Setting Up an NUnit Project
  • Writing the First NUnit Test
  • Debugging and Using Assertions
  • Assignment 1: Odd Number Checker
  • Assignment 1 Solution: Odd Number Checker
  • Assertion Models and Their Applications
  • Testing Multiple Values
  • Combining Unit Tests with Expected Results
  • Asserting Doubles and String Values
  • Using String Assert Helper Methods
  • Asserting Null Values
  • Global Initialization for Class


Module 4 - Advanced NUnit Testing Concepts

  • Asserting Collections with Helper Methods
  • Using Range Assert and Multiple Asserts
  • Working with Exceptions
  • Asserting Exceptions without Messages
  • Setting Up Inheritance in Tests
  • Asserting Object Types


Module 5 - Unit Testing with MOQ

  • Setting Up the Bank Account and Logger Classes
  • Demonstrating Integration Tests
  • Writing Unit Tests with Fake Logger
  • Introduction to Mocking with MOQ
  • MOQ Setup and Execution
  • Handling Missing MOQ and Conditional Return Values
  • Default Return Values in MOQ
  • Using MOQ with Out and Ref Parameters
  • Evaluating Return Values with MOQ
  • Implementing MOQ Properties and Callbacks
  • Verifying MOQ Calls


Module 6 - xUnit Testing Framework

  • Setting Up an xUnit Project
  • Comparing xUnit with Other Frameworks
  • Building the xUnit Calculator (Parts 1 & 2)
  • Using MOQ with xUnit
  • Custom xUnit Test Case for Customers


Module 7 - Real-World Example with NUnit

  • Setting Up the Main Project and Overview
  • Bongo Project Code Review
  • Bongo Models Date Checker (Parts 1 & 2)
  • Setting Up Data Access Unit Test Project
  • Working with In-Memory Databases for Unit Testing
  • Addressing Bugs and Pitfalls in Data Access Unit Tests
  • Configuring the Bongo Core Unit Test Project
  • Using MOQ in Bongo Core for GetAllBooking Test
  • Bongo Core Exception Handling in Unit Tests
  • Setting Up and Testing Save Booking in Bongo Core
  • Writing Test Cases for Return Codes in Bongo Core
  • Structuring and Separating Unit Tests in Bongo Core
  • Configuring the Bongo Web Test Project
  • Unit Testing the Bongo Web Index Action Method
  • Validating View Names in Bongo Web
  • Writing Controller Unit Tests for Bongo Web

Tags: Unit Testing in .NET Core Practice Exam, Unit Testing in .NET Core Online Course, Unit Testing in .NET Core Training, Unit Testing in .NET Core Tutorial, Learn Unit Testing in .NET Core, Unit Testing in .NET Core Study Guide