Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Unit Testing with Microsoft Fakes

40 minutes, 17 seconds


Right click “Save as…”

In this episode, Robert is joined by Carsten Duellmann and Ricardo Wickel, who show us how to improve our unit test using Microsoft Fakes. Fakes help you isolate the code you are testing by replacing other parts of the application with stubs or shims. These are small pieces of code that are under the control of your tests. By isolating your code for testing, you know that if the test fails, the cause is there and not somewhere else. Stubs and shims also let you test your code even if other parts of your application are not working yet.



Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • Great topic! I have learned something new today. Glad that I have recently followed @ch9 on twitter. 

  • The bad thing is that unlike in all other programming frameworks such as Java, JavaScript, Objective C, Python, you name it, this functionality is provided for free or can be easily achieved. For .NET you have to buy Visual Studio Primium Edition and above. I think that requiring me to pay so much for this feature is problematic because unit testing with mocks is such an essential need in today's software development.

  • Duncan MackenzieDuncanma "yeah that's awful close, but that's not why I'm so hard done by"

    @nektar: to be fair, you can build fakes and mocks in any version of Visual Studio, this is just an easier way to do it, a framework to make it easier. Understand that you'd like to have it for free, but I don't want other readers to think that doing unit testing with mocks is impossible outside of VS Ultimate. Channel 9 uses fakes in our unit tests, and we don't use any framework for this outside of dependency injection. Other frameworks do exist as well that have no VS-version requirement (such as http://hibernatingrhinos.com/oss/rhino-mocks)

  • Paulo Morgadopajocomo Paulo Morgado

    Using Thread.Sleep mixed with Tasks and specially using Thread.Sleep for waiting for a task to end show you need to learn a lot about Tasks and TAP.

Remove this comment

Remove this thread


Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.