Tag Archives: .NET

Errors in referencing .net standard library projects in .net framework based projects

By | August 9, 2018

Errors in referencing .net standard library projects in .net framework based projects is a rather common occurrence. This runtime error “Could not load file or assembly or one of its dependencies. The system cannot find the file specified” has to be one of the most frustrating error. Everything works fine on your machine and moment… Read More »

A simple c# events and delegates tutorial

By | September 11, 2017

This c# events and delegates tutorial has a simple aim: Make it easier for you to work with events in .NET. There will be no deep dive. Everything I discuss below about c# events and delegates has one purpose only: To enable you to start using events with confidence. Many people find it difficult to… Read More »

FakeItEasy and a case of method configuration

By | April 24, 2015

Recently while writing unit tests for a device driver I came across a situation. I had to simulate the call to the device to wait for sometime and then throw an error and then check if I handled it properly. This helped. This configures the Start method (which in real life issues command to the… Read More »

FakeItEasy and Protected methods

By | April 24, 2015

I often find myself dealing with protected methods in the unit testing land. Now if the method is public then this works A.CallTo(() => fakeObject.MethodUnderTest()).MustHaveHappened(); However when the method is protected then it does not fly. With FakeItEasy you have to take the different approach. A.CallTo(fakeObject).Where(x => x.Method.Name ==”MethodUnderTest”).MustHaveHappened(); And needless to say, the method… Read More »