public void For_Action5() { staticMock.For(() => Tests.StaticClass.ActionMethod(0, 0, 0, 0, 0)); StaticClass.ActionMethod5(1, 2, 3, 4, 5); staticMock.Received(1, () => Tests.StaticClass.ActionMethod(1, 2, 3, 4, 5)); }
public void For_Action8() { staticMock.For(() => Tests.StaticClass.ActionMethod(0, 0, 0, 0, 0, 0, 0, 0)); StaticClass.ActionMethod8(1, 2, 3, 4, 5, 6, 7, 8); staticMock.Received(1, () => Tests.StaticClass.ActionMethod(1, 2, 3, 4, 5, 6, 7, 8)); }
public void For_Action2() { staticMock.For(() => Tests.StaticClass.ActionMethod(0, 0)); StaticClass.ActionMethod2(1, 2); staticMock.Received(1, () => Tests.StaticClass.ActionMethod(1, 2)); }
public void For_Action1() { staticMock.For(() => Tests.StaticClass.ActionMethod(0)); StaticClass.ActionMethod1(1); staticMock.Received(1, () => Tests.StaticClass.ActionMethod(1)); }
public void For_Func9_ExpectReturns() { var expectText = "__ExpectText9__"; staticMock.For(() => Tests.StaticClass.FuncMethod(1, 2, 3, 4, 5, 6, 7, 8)).Returns(expectText); var text = StaticClass.FuncMethod8(1, 2, 3, 4, 5, 6, 7, 8); Assert.That(text, Is.EqualTo(expectText)); }
public void For_Func3_ExpectReturns() { var expectText = "__ExpectText3__"; staticMock.For(() => Tests.StaticClass.FuncMethod(1, 2)).Returns(expectText); var text = StaticClass.FuncMethod2(1, 2); Assert.That(text, Is.EqualTo(expectText)); }
public void Received_Action0Received2_NoException() { staticMock.For(() => Tests.StaticClass.ActionMethod()); StaticClass.ActionMethod0(); staticMock.Received(1, () => Tests.StaticClass.ActionMethod()); StaticClass.ActionMethod0(); staticMock.Received(2, () => Tests.StaticClass.ActionMethod()); }
public void Received_Action1_ReceivedCallsException() { staticMock.For(() => Tests.StaticClass.ActionMethod(0)); StaticClass.ActionMethod1(1); Assert.Throws <ReceivedCallsException>(() => { staticMock.Received(0, () => Tests.StaticClass.ActionMethod(1)); }); }
public void For_Action0_ReceivedCallsException() { staticMock.For(() => Tests.StaticClass.ActionMethod()); StaticClass.ActionMethod0(); Assert.Throws <ReceivedCallsException>(() => { staticMock.Received(0, () => Tests.StaticClass.ActionMethod()); }); }
public void ThrowsForAll_Default_ExpectException() { var specifiedText = "__NORMAL__"; var exceptionMessage = "Boom!"; staticMock.For(() => Tests.StaticClass.FuncMethod(0)).Returns(specifiedText); staticMock.ThrowsForAll(new Exception(exceptionMessage)); var ex = Assert.Throws <Exception>(() => StaticClass.FuncMethod1(1)); Assert.That(ex.Message, Is.EqualTo(exceptionMessage)); }
public void ReturnsForAll_Default_ExpectNormal() { var specifiedText = "__NORMAL__"; var defaultText = "__DEFAULT__"; staticMock.For(() => Tests.StaticClass.FuncMethod(0)).Returns(specifiedText); staticMock.ReturnsForAll(defaultText); var text = StaticClass.FuncMethod1(0); Assert.That(text, Is.EqualTo(specifiedText)); }