Entries:
Comments:
Posts:

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

Download

Right click “Save as…”

  • MP3 (Audio only)
  • MP4 (iPhone, Android)
  • High Quality MP4 (iPad, PC, Xbox)
  • Mid Quality MP4 (Windows Phone, HTML5, iPhone)

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.

 

Tags:

Follow the Discussion

  • 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

close

Comment on the Post

Already have a Channel 9 account? Please sign in