public async Task WhenContentAndSendingHandlerTypesMismatch_ExpectException() { var builder = new MockTypedBuilderFactory().Create().WithUri(MockUri); //act await builder.WithContent(TestResult.Default1()).AsPost().Advanced.OnSendingWithContent <Uri>(ctx => { }).ResultAsync <TestResult>(); }
public async Task WhenSentHandlerIsObjectType_ExpectSuccess() { var builder = new MockTypedBuilderFactory().Create().WithResult(TestResult.Default1()).WithUri(MockUri); //act var called = false; var result = await builder.WithContent(TestResult.Default1()) .AsPost() .Advanced .OnSent <object>(ctx => { called = true; }) .ResultAsync <TestResult>(); result.ShouldNotBeNull(); called.ShouldBeTrue(); }