public async Task <CoffeePlaceResponse> Execute(CreateCoffeePlaceCommand command)
        {
            var coffeePlace = await _coffeePlaceService
                              .Create(command);

            await Commit();

            return(new CoffeePlaceResponse(coffeePlace));
        }
Пример #2
0
        public async Task Should_create_a_coffee_place()
        {
            var command = new CreateCoffeePlaceCommandBuilder()
                          .Build();

            var coffeePlace = await _coffeePlaceService
                              .Create(command);

            await _coffeePlaceRepository
            .Received(1)
            .AddAsync(Arg.Is <CoffeePlace>(a =>
                                           a.Name == command.Name));

            coffeePlace
            .Name
            .Should()
            .Be(command.Name);
            coffeePlace
            .PersonCoffeePlaceAssociations
            .Should()
            .BeEmpty();
        }