Moles: Mocking the Un-Mockable
Published April 26th, 2010 Under Open Source Tools, Software Testing | Leave a Comment
In this episode we are going to take at how to use Pex and Moles for .Net. Unit testing is great, but most free isolation frameworks require that your mocks implement an interface. But what do you do when the class you are trying to mock is static or sealed with no interface. If you can’t modify the class then your unit testing efforts are usually stuck. Moles, the new free isolation framework from Microsoft, supports mocking almost any CLR based class (including sealed and static classes).
http://www.dimecasts.net/Content/WatchEpisode/170
Learning how to use Manual Mocks for Testing
Published March 1st, 2010 Under Software Testing | Leave a Comment
In this episode we are going to take a look at how to use manual mocks for testing. Often times when creating unit tests we need to work in isolation in order to cover the paths we are attempting to test. When we want to test in isolation you can use a testing technique where you mock out your dependencies. When using Mocks you can either do it manually (what we are looking at) or you can use a mocking framework like Rhino Mocks. Either way you achieve the same results.
http://www.dimecasts.net/Content/WatchEpisode/164
Isolation Frameworks: Mocking Out/Ref Arguments
Published September 7th, 2009 Under Open Source Tools, Software Testing | Leave a Comment
In this episode we are going to continue our series on learning how to use an isolation framework (Rhino Mocks) to help create simpler and more reliable unit tests. We are going to focusing this episode on how to setup you mocks when you need to mock a class with either Out or Ref arguments.
http://www.dimecasts.net/Content/WatchEpisode/138
Interaction Based Testing with Rhino Mocks
Published August 28th, 2009 Under Open Source Tools, Software Testing | Leave a Comment
Beyond the simplest scenarios, all objects had collaborators that they work with. This flies in the face of testing objects in isolation. This is the problem that mock objects were created to solve. In this talk you will learn what mock objects are, how to utilize them and best practices on when / how to utilize them. Rhino Mocks is a mock objects framework for .Net whose core goals are to let the developer rely on the compiler work well with refactoring tools.
PowerMock
Published August 24th, 2009 Under Open Source Tools, Software Testing | Leave a Comment
PowerMock can be used to test code normally regarded as untestable! Have you ever heard anyone say that you should never use static or final methods in your code because it makes them impossible to test? Have you ever changed a method from private to protected for the sake of testability? What about avoiding “new”? Think again! PowerMock lets you mock static methods, remove static initializers, allow mocking without dependency injection and much much more. And it works just as well for J2EE as J2ME! This presentation will give the audience a good understanding on how to easily unit-test your code without the limitations of the common mock frameworks such as EasyMock and JMock.
keep looking »