Skip to content

npinchot/MoqKoans

 
 

Repository files navigation

==========
The Moq Koans
==========

This is an attempt to make a set of Koans for learning how to mock objects with Moq.
The Koans are written in C# and use MSTest.

-----
What are Koans?
-----
A koan is a Zen Buddhism story or statement that focuses not on a rational answer but
more of an intuitive one. These lessons intend the answerer to look beyond the obvious
for a deeper smarter more meaningful answer.
The goal of a koan is not the answer, but thinking about the question.

-----
How do I use this project?
-----
To use these Koans, start by opening the file "1_Interfaces.cs".

Go through each Unit Test in order.

  1. Run the test to see that it is currently failing.

  2. Anywhere you see underscores (___), replace it with appropriate code.
     Think about what the answer should be, and why.
	 Sometimes the test failure message will provide some hint as to what the answer is.

  3. Rerun the test to see if it passes.
     This process of verifying the test is failing, then fixing it follows the "red-green-refactor"
	 approach to test-driven development. In this case we aren't worrying about refactoring,
	 but it is still good to get in the "red-green" flow of testing.

As you finish all the unit tests in that file, move to the next .cs file in the project.

About

A set of Koans for learning to mock with Moq in C# / .NET

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%