Exemplo n.º 1
0
        public async Task Should_update_a_coffee_place()
        {
            var command = new UpdateCoffeePlaceCommandBuilder()
                          .Build();

            var coffeePlace = new CoffeePlaceBuilder()
                              .WithId(command.CoffeePlaceId)
                              .Build();

            _coffeePlaceRepository
            .GetByIdAsync(command.CoffeePlaceId)
            .Returns(coffeePlace);

            var response = await _coffeePlaceService
                           .Update(command);

            response
            .Id
            .Should()
            .Be(command.CoffeePlaceId);
            response
            .Name
            .Should()
            .Be(command.Name);
            response
            .PersonCoffeePlaceAssociations
            .Should()
            .BeEmpty();
        }
        public async Task <CoffeePlaceResponse> Execute(UpdateCoffeePlaceCommand command)
        {
            var coffeePlace = await _coffeePlaceService
                              .Update(command);

            await Commit();

            return(new CoffeePlaceResponse(coffeePlace));
        }