public async Task ShouldPass() { var handler = new PingHandler(); var request = new PingRequest { Message = "Hello World" }; var response = await handler.Handle(request, CancellationToken.None); response.Message.Should().Be("Hello World"); }
public async Task Should_call_abstract_handler() { IRequestHandler <Ping, Pong> handler = new PingHandler(); var response = await handler.Handle(new Ping() { Message = "Ping" }, default); response.Message.ShouldBe("Ping Pong"); }
public async Task Should_Call_Abstract_Handler() { // Arrange IRequestHandler <Ping, Pong> requestHandler = new PingHandler(); var expected = "Ping Pong"; // Act var response = await requestHandler.Handle(new Ping() { Message = "Ping" }, default(CancellationToken)); // Assert Assert.AreEqual(expected, response.Message); }
public async Task Should_call_abstract_unit_handler() { var builder = new StringBuilder(); var writer = new StringWriter(builder); IRequestHandler <Ping, Unit> handler = new PingHandler(writer); await handler.Handle(new Ping() { Message = "Ping" }, default); var result = builder.ToString(); result.ShouldContain("Ping Pong"); }