public static void OrderedAssertionOnInterfacesWithCommonParent(ISomethingBaz baz, ISomethingQux qux, IOrderableCallAssertion lastAssertion, Exception exception) { "Given a Fake baz" .x(() => baz = A.Fake <ISomethingBaz>()); "And a Fake qux implementing an interface in common with baz" .x(() => qux = A.Fake <ISomethingQux>()); "And a call on qux" .x(() => qux.QuxMethod()); "And a call on baz" .x(() => baz.BazMethod()); "When I assert that the qux call was made" .x(() => lastAssertion = A.CallTo(() => qux.QuxMethod()).MustHaveHappened()); "And I make the same assertion again" .x(() => exception = Record.Exception(() => lastAssertion.Then(A.CallTo(() => qux.QuxMethod()).MustHaveHappened()))); "Then the second assertion should fail" .x(() => exception.Should().BeAnExceptionOfType <ExpectationException>()); }
public static void OrderedAssertionOnInterfacesWithCommonParent(ISomethingBaz baz, ISomethingQux qux, IOrderableCallAssertion lastAssertion, Exception exception) { "Given a Fake baz" .x(() => baz = A.Fake<ISomethingBaz>()); "And a Fake qux implementing an interface in common with baz" .x(() => qux = A.Fake<ISomethingQux>()); "And a call on qux" .x(() => qux.QuxMethod()); "And a call on baz" .x(() => baz.BazMethod()); "When I assert that the qux call was made" .x(() => lastAssertion = A.CallTo(() => qux.QuxMethod()).MustHaveHappened()); "And I make the same assertion again" .x(() => exception = Record.Exception(() => lastAssertion.Then(A.CallTo(() => qux.QuxMethod()).MustHaveHappened()))); "Then the second assertion should fail" .x(() => exception.Should().BeAnExceptionOfType<ExpectationException>()); }