About
This blog is mostly about my work, but expect an occasional home project, productivity tip and tooling review.Search
Categories
- Conference (20)
- Development (208)
- Security (17)
- Test (32)
- Tooling (166)
- Uncategorized (168)
Most used tags
Tag Archives: nsubstitute
Async unit test
With the .NET framework 4.5 making stuff asynchronous has become very easy with async-await. I’ve looked into unit testing this new way of programming and found that Microsoft thought about this too.
During my exercise I had to replace my trusted RhinoMocks by NSubstitute when the tests are run in parallel. Seems that RhinoMocks is not thread safe. More about that in the references. Continue reading
Partial subs with nsubstitute
Finally got the hang of partial s(t)ubs with nsubstitute. The key is that the original method is called when setting up the sub. To avoid this use argument matchers and the DoNotCallBase() method. Property To test/setup the property to return … Continue reading