public async Task Should_get_all_coffee_places() { var coffeePlace1 = new CoffeePlaceBuilder() .Build(); var coffeePlace2 = new CoffeePlaceBuilder() .Build(); var coffeePlaces = new List <CoffeePlace> { coffeePlace1, coffeePlace2 }; _coffeePlaceRepository .GetAllAsync() .Returns(coffeePlaces); var coffeePlacesResponse = await _coffeePlaceService .GetAll(); coffeePlacesResponse .Should() .SatisfyRespectively( item1 => { item1 .Should() .BeEquivalentTo(coffeePlace1, opt => opt.ExcludingMissingMembers()); }, item2 => { item2 .Should() .BeEquivalentTo(coffeePlace2, opt => opt.ExcludingMissingMembers()); }); }
public async Task <ActionResult <IList <CoffeePlaceResponse> > > GetAll() { var coffeePlaces = await _coffeePlaceService.GetAll(); return(Ok(coffeePlaces)); }