Using Generic Test Classes and EntityFramework test doubles to facilitate Unit Testing

This is some kind of follow-up to my previous posts regarding generic Odata controllers and decoupled domain managers. If you have followed my posts Using Dependency Injection with StructureMap to decouple business logic from WebApi OData Controllers and Simplifying OData Controllers by using generic controller classes you will remember that we use managers that contain […]

[NoBrainer] Mocking DateTimeOffset and DateTime with Telerik JustMock return unexpected values

JustMock DateTimeOffset

Today’s post goes rather quick … Telerik JustMock in its commercial (i.e. non-free) version provides you the option to mock static classes, which comes in really handy when you want to mock something like DateTimeOffset. However, in our scenario it yielded some surprising results… In my project I needed to mock a DateTimeOffset to have […]

[NoBrainer] C# UnitTesting with CodeContracts and Telerik JustMock

When using Microsoft CodeContracts your Contract.Requires and Contract.Ensures statements will throw a ContractException which you cannot catch (per design). This means that you cannot use the [ExceptedException] attribute to assert them. Furthermore when mocking with Telerik Justock you cannot use Contract.Ensures and Contract.Requires at all in your stubs, as the stub is expected to be […]

Telerik JustMock in Action

While searching for a mocking framework for C# .NET we of d-fens stumbled over JustMock. JustMock is a mocking framework for unit testing developed and maintained by Telerik. Besides JustMock Telerik provides a huge palette of development tools. The probably most popular tool developed by them is Fiddler. Now let’s go back to JustMock. There […]