public async Task <ActionResult> GetList() { GetListTamagochiQuery listQuery = new GetListTamagochiQuery(); var result = await _mediator.Send(listQuery); return(Ok(result.RequestResult)); }
public async Task GetListTamagochis_Success() { var command = new GetListTamagochiQuery(); var response = await _handler.Handle(command, default); Assert.IsTrue(response.Ok); Assert.IsTrue(response.RequestResult.Count() == 4); }
public async Task <ActionResult> Get(int id) { GetListTamagochiQuery query = new GetListTamagochiQuery() { Filter = q => q.Id == id }; var a = await _mediator.Send(query); return(Ok(a.RequestResult)); }
public async Task GetListTamagochis_IdDoesNotExist_ReturnEmptyList() { var command = new GetListTamagochiQuery(); command.Filter = tamagochi => tamagochi.Id == 99; var response = await _handler.Handle(command, default); Assert.IsTrue(response.Ok); Assert.IsTrue(!response.RequestResult.Any()); }