public static async Task ExecuteViaReflectionAsync_TResult___Should_throw_same_exception_throw_by_protocol___When_protocol_throws() { // Arrange var operation = new ThrowingReturningOp(); var protocol = new ThrowingProtocol(); // Act var actual = await Record.ExceptionAsync(() => protocol.ExecuteViaReflectionAsync <bool>(operation)); // Assert actual.AsTest().Must().BeOfType <InvalidOperationException>(); actual.Message.AsTest().Must().BeEqualTo("execute-returning-async"); }
public Task <bool> ExecuteAsync(ThrowingReturningOp operation) { throw new InvalidOperationException("execute-returning-async"); }
public bool Execute(ThrowingReturningOp operation) { throw new InvalidOperationException("execute-returning-sync"); }