public async Task GetAllAsyncTest() { var expected = new List <string> { "Audi", "Ford", "Jeep", "Nissan", "Toyota" }; var actual = await _brandStorage.GetAllAsync(); Assert.Equal(expected, actual.Select(x => x.Name)); }
public async Task <ActionResult> GetAll() { try { var response = await _brandStorage.GetAllAsync().ConfigureAwait(false); return(StatusCode(StatusCodes.Status200OK, response)); } catch (Exception exeption) { return(StatusCode(StatusCodes.Status500InternalServerError, exeption.Message)); } }