public async Task Should_get_a_coffee_place_by_id() { const long coffeePlaceId = 1; var coffeePlace = new CoffeePlaceBuilder() .WithId(coffeePlaceId) .Build(); _coffeePlaceRepository .GetByIdAsync(coffeePlaceId) .Returns(coffeePlace); var coffeePlaceResponse = await _coffeePlaceService .GetByIdWithDetails(coffeePlaceId); coffeePlaceResponse .Should() .BeEquivalentTo(coffeePlace, opt => opt.ExcludingMissingMembers()); }
public async Task <ActionResult <CoffeePlaceWithDetailsResponse> > Get([FromRoute] long id) { var coffeePlace = await _coffeePlaceService.GetByIdWithDetails(id); return(Ok(coffeePlace)); }