FakeItEasy unit test error - System.NotImplementedException : The method or operation is not implemented.
So I was trying to set up a fake and got an error pointing towards an unimplemented ToString() method in my fake db context.
The reason? I was attempting to mock a call on an object that was not a fake! I should have created my context as A.Fake() whereas I was using the built-in EF FakeSmartDbContext(), which of course is not a fake object!
Presumably, FakeItEasy was trying to calling ToString to generate a useful error but for reasons unknown, FakeSmartDbContext has ToString coded with a NotImplementedException!
Replace FakeSmartDbContext with A.Fake() and we're all good!
The reason? I was attempting to mock a call on an object that was not a fake! I should have created my context as A.Fake
Presumably, FakeItEasy was trying to calling ToString to generate a useful error but for reasons unknown, FakeSmartDbContext has ToString coded with a NotImplementedException!
Replace FakeSmartDbContext with A.Fake