public void ThrowIfNoStepInVeryStrictMode() { var methodMock = new ActionMethodMock(new object(), "ClassName", "InterfaceName", "MemberName", "MockName", Strictness.VeryStrict); var ex = Assert.Throws <MockMissingException>(() => methodMock.Call()); Assert.Equal(MockType.Method, ex.MemberType); }
public void DoNothingIfClearedInLenientMode() { var methodMock = new ActionMethodMock(new object(), "ClassName", "InterfaceName", "MemberName", "MockName", Strictness.Lenient); var nextStep = NextStepFor(methodMock); methodMock.Clear(); methodMock.Call(); Assert.Equal(0, nextStep.Count); }
public void SendMockInformationToStep() { var methodMock = new ActionMethodMock(new object(), "ClassName", "InterfaceName", "MemberName", "MockName", Strictness.Lenient); var nextStep = NextStepFor(methodMock); methodMock.Call(); Assert.Equal(1, nextStep.Count); Assert.Same(methodMock, nextStep.LastMockInfo); }
public void ThrowIfClearedInVeryStrictMode() { var methodMock = new ActionMethodMock(new object(), "ClassName", "InterfaceName", "MemberName", "MockName", Strictness.VeryStrict); var nextStep = NextStepFor(methodMock); methodMock.Clear(); var ex = Assert.Throws <MockMissingException>(() => methodMock.Call()); Assert.Equal(MockType.Method, ex.MemberType); Assert.Equal(0, nextStep.Count); }
public void SendMockInformationAndParametersToStep() { var actionMock = new ActionMethodMock <int>(new object(), "ClassName", "InterfaceName", "MemberName", "MockName", Strictness.Lenient); var nextStep = NextStepFor(actionMock); actionMock.Call(5); Assert.Equal(1, nextStep.Count); Assert.Same(actionMock, nextStep.LastMockInfo); Assert.Equal(5, nextStep.LastParam); }
public void DoNothingIfNoStepInLenientMode() { var methodMock = new ActionMethodMock(new object(), "ClassName", "InterfaceName", "MemberName", "MockName", Strictness.Lenient); methodMock.Call(); }
public ActionMethodMockSetNextStepTests() { _parameterLessActionMock = new ActionMethodMock(new object(), "ClassName", "InterfaceName", "MemberName", "MockName", Strictness.Lenient); _actionMock = new ActionMethodMock <int>(new object(), "ClassName", "InterfaceName", "MemberName", "MockName", Strictness.Lenient); }