forked from rowanmiller/EntityFramework.Testing
-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Hi guys!
I tried to make a mock for my simple DbContext and It works fine For MockBehavior.Default, But when I try to use MockBehavior.Strict I cannot even get an Object of this mock.
I made some workaround for one exception using additional Setup for Set<> method:
_myContextMock.Setup(x => x.MyEntities).Returns(mockSetObject);
_myContextMock.Setup(x => x.Set<MyEntity>()).Returns(mockSetObject);
but now got:
System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> Moq.MockException : IEnumerable.GetEnumerator() invocation failed with mock behavior Strict.
All invocations on the mock must have a corresponding setup.
And it is when I try to get an Object of my Mock, I mean when I use _myContextMock.Object
Metadata
Metadata
Assignees
Labels
No labels