public void Invoke_ShouldCallInvokeOnBothMocks_AndReturnFalse() { // Arrange MockMockMethodWithParam <string> mockMockMethodWithParam = new MockMockMethodWithParam <string> .Builder().Invoke().Build(); MockMockMethodWithResponse <bool> mockMockMethodWithResponse = new MockMockMethodWithResponse <bool> .Builder().Invoke(false).Build(); MockMethodWithParamAndResponse <string, bool> subject = new ReflectionObject <MockMethodWithParamAndResponse <string, bool> >("methodName", mockMockMethodWithParam, mockMockMethodWithResponse).Object(); // Act bool actual = subject.Invoke("expected"); // Assert actual.Should().BeFalse(); }
public void Invoke_ShouldFlagInvoked_AndNotExcept() { // Arrange MockMockMethodWithParam <string> mockMockMethodWithParam = new MockMockMethodWithParam <string> .Builder().Invoke().Build(); MockMockMethodWithResponse <bool> mockMockMethodWithResponse = new MockMockMethodWithResponse <bool> .Builder().Invoke(true).Build(); MockMethodWithParamAndResponse <string, bool> subject = new ReflectionObject <MockMethodWithParamAndResponse <string, bool> >("methodName", mockMockMethodWithParam, mockMockMethodWithResponse).Object(); // Act bool actual = subject.Invoke("expected"); // Assert subject.AssertInvoked(); }