Mocking with Moq and xUnit
Offered By: Pluralsight
Course Description
Overview
Moq, the most popular mocking library for .NET, makes it easy to create mock dependencies to make testing easier. Learn more in this course!
Writing unit tests can be difficult, time-consuming, and slow when you can't isolate the classes you want to test from the rest of the system. In this course,Mocking with Moq 4 and xUnit, you'll learn how to create mocks and use them as dependencies to the classes you want to test. First, you'll discover how to configure mocked methods and properties to return specific values. Next, you'll learn how to perform behavior/interaction testing to check your classes are interacting correctly with their dependencies. Finally, you'll explore how to setup mock exceptions, mock events, and use additional mocking techniques. When you're finished with this course, you'll have the necessary knowledge to use Moq to unit test your classes in isolation by creating and using mock objects.
Writing unit tests can be difficult, time-consuming, and slow when you can't isolate the classes you want to test from the rest of the system. In this course,Mocking with Moq 4 and xUnit, you'll learn how to create mocks and use them as dependencies to the classes you want to test. First, you'll discover how to configure mocked methods and properties to return specific values. Next, you'll learn how to perform behavior/interaction testing to check your classes are interacting correctly with their dependencies. Finally, you'll explore how to setup mock exceptions, mock events, and use additional mocking techniques. When you're finished with this course, you'll have the necessary knowledge to use Moq to unit test your classes in isolation by creating and using mock objects.
Syllabus
- Course Overview 1min
- Getting Started with Mocking and Moq 22mins
- Configuring Mocked Methods 34mins
- Configuring Mock Object Properties 22mins
- Implementing Behavior Verification Tests 22mins
- Using Additional Moq Mocking Techniques 32mins
Taught by
Jason Roberts
Related Courses
Introduction to Functional ProgrammingDelft University of Technology via edX MongoDB for .NET Developers
MongoDB University 基于.Net的Web开发技术
Xi'an Jiaotong University via Coursera Web Development with ASP.NET C# and Entity Framework Code-First
Canvas Network Blazor and JavaScript Interoperability
Coursera Project Network via Coursera