Mocking ICollection property in entity?

You can't mock the Count method you are using, because it is an extension method. It isn't a method defined on ICollection.

There's no need to mock the collection when you can simply verify whether the exception was thrown using the real collection rather than a mock. As you're using MsTest rather than NUnit, you can't simply add an ExpectedException attribute to verify that the exception is thrown, but you can do something like the following.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions