Unit Testing .Net Core Applications with xUnit .net & MOQ
4.1 (448 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,528 students enrolled

Unit Testing .Net Core Applications with xUnit .net & MOQ

Mocking Techniques, Test Driven Development (TDD), and Unit Testing Legacy Code with xUnit.NET + Interview Questions
4.1 (448 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,528 students enrolled
Created by Aref K.
Last updated 5/2019
English [Auto]
Current price: $59.99 Original price: $99.99 Discount: 40% off
1 day left at this price!
30-Day Money-Back Guarantee
This course includes
  • 3.5 hours on-demand video
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Learn all the features and capabilities of xUnit .net
  • Learn writing unit tests using the Mocking technique and xUnit
  • Learn how to write unit tests for legacy (old) applications
  • Learn Test Driven Development (TDD) with xUnit
  • Learn how to measure test coverage
  • Take the interview questions and get ready for your next interiew
Course content
Expand all 39 lectures 03:30:49
+ Introduction
8 lectures 19:38

Get to know your instructor and underestand the goals of the course

Preview 01:24

XUnit .Net is a Free and Open Source unit testing framework for .Net and .Net Core applications. It can be used to test Xamarin applications as well.

Preview 01:05

Learn about the main features and design goals of XUnit .Net

Preview 02:21

Learn that how you will add the required NuGet packages and how you will write your first ever test method with XUnit

Writing your first Unit Test
Execute Unit Tests in Visual Studio
Execute Unit Tests via Command Line
Execute Unit Tests with ReSharper
Phases of Unit Testing
+ Asserts
8 lectures 52:02
The Assert Phase
Asserting numeric values
Asserting string values
Asserting boolean values as well as null values
Asserting Collections
Asserting a range of values
Asserting Exceptions
Asserting object types
+ Arrange Phase, and Managing Tests
5 lectures 40:41
Collections and Traits
Class Fixtures and IClassFixture
Constructors and IDisposable
Collection Definition
Parallel Execution of Tests
+ Data Driven Tests
5 lectures 23:53
Data Driven Tests in XUnit .net and the "Theory" attribute
Passing parameters to unit tests with inline attributes
Passing parameters to unit tests from external resources
Sharing test data across multiple unit test methods with custom attributes
+ Mocking and Unit Testing with MOQ & xUnit
7 lectures 37:05
Creating the xUnit Test Project
Writing our first test with Mock and xUnit
Testing when ModelState is invalid
Setting Up the Mocked Objects
Writing a Test with Arrange, Act and Assert Format
+ Unit Testing Legacy Code
3 lectures 20:40
The "Sprout Method" Technique
The "Sprout Class" Technique
+ More xUnit.net
1 lecture 04:47
Measuring Unit Test Coverage
+ Interview Questions
0 lectures 00:00

Interview around unit testing with C# and .NET Core

Unit Testing
4 questions
  • C# programming beginner level
  • Visual Studio 2015, 2017, 2019 or Visual Studio for Mac

Attention all .NET Core developers looking to develop new skills and take their career to the next level – this is the course to help you get there!

This is a focused course on the Unit Testing .NET Core 3 Projects with xUnit .net ; an open source unit testing tool for .Net Framework and .Net Core applications and the standard tool for unit testing C#, VB.NET and F# projects in Visual Studio

Being a proficient and confident user of this tool will allow you to execute key .NET core development tasks.

In this course, I will teach you:

  • the fundamentals of the xUnit .net ;

  • how to write effective and well-organised unit tests for your .NET core applications;

  • how to use data driven testing capabilities;

  • how to use mocking frameworks, including MoQ;

  • how to use test driven development (TDD) technique;

  • how to test legacy (old) code;

  • how to write unit tests for ASP.NET Core MVC applications

    No pre-requisite knowledge is required to complete this course, but a positive attitude and a willingness to learn is a must!

Questions are always welcome from students and can be asked in the Q&A section of the course. I endeavor to respond to these quickly so I can create an engaging learning environment for my students

Who this course is for:
  • C#, VB .Net or F# progrmmers
  • .NET Framework and/or ASP .NET developers
  • .NET Core programmers
  • Testers and QA Engineers
  • Xamarin developers