Tag Archives: fakeiteasy

Strict mocking vs Loose mocking

By | May 6, 2015

Strict mocking vs Loose mocking is a question something which comes up often when various mocking frameworks like Moq, NSubstitute, Rhino Mocks, FakeItEasy are compared. So what is it? Suppose you create a fake of a class and do not configure the behavior of one of its method or property. Strict mocking:  If the test… 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 »