We often need to write unit tests for code that accesses an external resource such as a database or a file file system. If such resources are not available, the only way to ensure that the tests can ...
When you're testing an ASP.NET MVC controller (or, really, any class at all) you want to make sure the code that fails is the code you're testing. Moq provides a simple way to isolate the code you're ...
If you run an automated test and your test fails then you want to know that it's your fault -- not a problem in someone else's code or the result of a change in your test data. Moq lets you do that in ...
Learn when static methods can’t be unit tested and how to use wrapper classes and the Moq and xUnit frameworks to unit test them when they can When building or working in .NET applications you might ...
The idea of unit testing has been around for many years. "Test early, test often" is a mantra that concerns unit testing as well. However, in practice, not many software projects have the luxury of ...
Right now, I'm half-way thru "The Art of Unit Testing" book and wrapping my head around Stubs and Mocks. As an exercise to consolidate and validate what I'm learning, I've created a simple chart of ...