public async Task Handle_GivenNotFoundException() { //Arrange const int updatedId = 50; var command = new UpdateAuthenticationOptionCommand { AuthenticationOptionId = updatedId, RouteId = 30 }; //Assert await Assert.ThrowsAsync <NotFoundException>(() => _handler.Handle(command, CancellationToken.None)); }
public async Task Handle_GivenValidResult() { //Arrange const int updatedId = 13; var command = new UpdateAuthenticationOptionCommand { AuthenticationOptionId = updatedId, RouteId = 30 }; //Act await _handler.Handle(command, CancellationToken.None); var unit = await Context.AuthenticationOptions.FindAsync(updatedId); //Assert Assert.NotNull(unit); Assert.Equal(updatedId, unit.AuthenticationOptionId); Assert.Equal(30, unit.RouteId); }
public async Task <IActionResult> Update([FromBody] UpdateAuthenticationOptionCommand command) { await Mediator.Send(command); return(NoContent()); }