public async Task Handle_GivenNotFoundException() { //Arrange const int validId = 50; var query = new GetRouteDetailQuery { Id = validId }; //Assert await Assert.ThrowsAsync <NotFoundException>(() => _handler.Handle(query, CancellationToken.None)); }
public async Task Handle_GivenValidResult() { //Arrange const int validId = 10; var query = new GetRouteDetailQuery { Id = validId }; //Act var result = await _handler.Handle(query, CancellationToken.None); //Assert Assert.NotNull(result.Dto); Assert.IsType <RouteDetailViewModel>(result); Assert.True(result.Success); }