public void CallBackWithDifferentSignature() { InvalidOperationException ex = Assert.Throws<InvalidOperationException>( () => callback = new CallbackExpectation( new FakeInvocation(method), new DelegateDefinations.IntArgDelegate(OneArg), new Range(1, 1))); Assert.Equal("Callback arguments didn't match the method arguments", ex.Message); }
public void ExceptionWhenArgsDontMatch() { InvalidOperationException ex = Assert.Throws<InvalidOperationException>(() => callback = new CallbackExpectation(new FakeInvocation(method), new DelegateDefinations.NoArgsDelegate(VoidNoArgs), new Range(1, 1)) ); Assert.Equal("Callback arguments didn't match the method arguments", ex.Message); }
protected override IExpectation GetExpectation(MethodInfo m, Range r, int actual) { CallbackExpectation expectation = new CallbackExpectation(new FakeInvocation(m), new DelegateDefinations.NoArgsDelegate(VoidNoArgs), new Range(1, 1)); SetupExpectation(expectation, r, actual); return expectation; }
public void CallMethodWhenTestIsExpected() { callback = new CallbackExpectation(new FakeInvocation(method), new DelegateDefinations.ThreeArgsDelegate(ThreeArgsDelegateMethod), new Range(1, 1)); callback.IsExpected(new object[] {1, "", 3.3f}); Assert.True(callbackCalled); }