Mocking with Moq and NUnit
Offered By: Pluralsight
Course Description
Overview
Writing unit tests is hard when dependencies between classes make it tough to separate what's being tested from the rest of the system. Moq is a mocking library for .NET that makes it easy to create mock objects and make writing unit tests easier.
Writing effective unit tests can be tricky when dependencies between classes make it hard to separate what's being tested from the rest of the system. In this course, Mocking with Moq 4 and NUnit, you will gain the ability to easily isolate parts of your codebase for testing purposes. First, you will learn how to substitute real dependencies for mock objects. Next, you will discover how to configure mocked methods, properties, exceptions, and events. Finally, you will explore how to create behavior-based tests and also how to create partial mocks from existing classes. When you’re finished with this course, you will have the skills and knowledge of mocking with Moq needed to create automated tests that use mock objects.
Writing effective unit tests can be tricky when dependencies between classes make it hard to separate what's being tested from the rest of the system. In this course, Mocking with Moq 4 and NUnit, you will gain the ability to easily isolate parts of your codebase for testing purposes. First, you will learn how to substitute real dependencies for mock objects. Next, you will discover how to configure mocked methods, properties, exceptions, and events. Finally, you will explore how to create behavior-based tests and also how to create partial mocks from existing classes. When you’re finished with this course, you will have the skills and knowledge of mocking with Moq needed to create automated tests that use mock objects.
Syllabus
- Course Overview 1min
- Getting Started with Moq 27mins
- Configuring Mock Method Return Values 20mins
- Working with Mock Properties 17mins
- Checking That Mock Methods and Properties Are Used 20mins
- Using Partial Mocks and Advanced Mocking Techniques 25mins
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