Mocking With Moq

A look at mocking objects with the Moq framework.
Course info
Rating
(867)
Level
Intermediate
Updated
Jul 25, 2012
Duration
1h 53m
Table of contents
Description
Course info
Rating
(867)
Level
Intermediate
Updated
Jul 25, 2012
Duration
1h 53m
Description

This prepares you with the fundamental reasons that you would want to use a mocking framework. It also covers, in detail, how to create and use mock objects using the Moq framework as well as advanced usages of that framework.

About the author
About the author

Donald Belcham is a senior software developer, independent contractor, and agile development expert who is a strong supporter of fundamental OO patterns and practices. Since 2007, he has been awarded the Microsoft MVP Award in C# and is a member of the JetBrains Academy.

More from the author
What’s New in PostSharp v3
Intermediate
51m
30 Jan 2014
Microsoft Fakes Fundamentals
Intermediate
1h 56m
10 Oct 2012
FakeItEasy
Intermediate
1h 21m
20 Aug 2012
More courses by Donald Belcham
About the author

Jim Cooper is a software developer at Pluralsight. With more than 20 years of software development experience, he has gained a passion for Agile software development -- especially Lean.

More from the author
Vue.js Fundamentals
Intermediate
5h 5m
21 Jun 2018
Angular Best Practices
Intermediate
1h 41m
23 Oct 2017
Angular Fundamentals
Intermediate
9h 35m
18 Jan 2017
More courses by Jim Cooper
Section Introduction Transcripts
Section Introduction Transcripts

Introduction
Hi, my name is Donald Belcham, and in this Pluralsight on demand video we're going to talk about the Moq Mocking framework. In this course, we're going to introduce you to the Moq framework. After that, Jim Cooper's going to introduce you to mocking as a testing technique, and I'll cover Hand Rolled Mocks as an alternative to using framework, such as Moq. After that, we'll do a deep-dive into mocking with the Moq framework, and we'll look at some advanced mocking techniques as well. In this module, we're going to talk about what is the Moq framework, and how you can go about getting started using it.

Using Test Doubles to Improve Unit Tests
Hello, this is Jim Cooper from Pluralsight, and I'll be taking you through this module on using test doubles to improve your unit tests.

Hand Rolled Mock Objects
Hi, my name is Donald Belcham, and in this Pluralsight module, we're going to talk about hand-rolled mock objects. This module is going to show you how hand-rolled mock objects work, and what's involved in creating them, and we're also going to talk about the good, the bad, and the ugly things that you're going to see if you decide to use hand-rolled mock objects in your testing work.

Mocking with Moq
Hi, my name is Donald Belcham and in this Pluralsight video we're going to look at how to do mocking with the moq framework. In this module, we're going to look at a number of things, the first being the triple A or Arrange, Act, Assert syntax. How you do verification of your mock objects? How can we setup return values from the mock objects as well as pass in parameters to them? We'll look at throwing exceptions from the mock objects as well as how we can mock the properties for testing purposes. We'll also look at how you can use stubbing to assist in your testing. And we'll finally look at how you can mock events occurring between different objects.

Advanced Mocking with Moq
Hi, my name is Donald Belcham and in this Pluralsight video, we're going to look at Advanced Mocking with the Moq Framework. There are many different ways you can mock object using the Moq framework. What we're going to look at in this module is the difference between strict and loose mocking in the framework, how we can mock out base class implementations, the ability to do recursive mocking inside of large objects, how we can centralize our mock creation so we have standardized mock objects, and finally, how we can mock protected members over objects.