public async Task ForCreateTentativeReservationCommand_ShouldAddNewReservation()
        {
            // Given
            var repository      = new FakeRepository <Reservation>();
            var numberGenerator = new FakeReservationNumberGenerator();

            var commandHandler = new ReservationCommandHandler(
                repository,
                numberGenerator
                );

            var command = CreateTentativeReservation.Create(Guid.NewGuid(), Guid.NewGuid());

            // When
            await commandHandler.Handle(command, CancellationToken.None);

            //Then
            repository.Aggregates.Should().HaveCount(1);

            var reservation = repository.Aggregates.Values.Single();

            reservation
            .IsTentativeReservationWith(
                command.ReservationId,
                numberGenerator.LastGeneratedNumber,
                command.SeatId
                )
            .HasTentativeReservationCreatedEventWith(
                command.ReservationId,
                numberGenerator.LastGeneratedNumber,
                command.SeatId
                );
        }
        public async Task <IActionResult> CreateTentative([FromBody] CreateTentativeReservationRequest request)
        {
            Guard.Against.Null(request, nameof(request));

            var reservationId = idGenerator.New();

            var command = CreateTentativeReservation.Create(
                reservationId,
                request.SeatId
                );

            await commandBus.Send(command);

            return(Created("api/Reservations", reservationId));
        }
    public async Task <IActionResult> CreateTentative([FromBody] CreateTentativeReservationRequest request)
    {
        if (request == null)
        {
            throw new ArgumentNullException(nameof(request));
        }

        var reservationId = idGenerator.New();

        var command = CreateTentativeReservation.Create(
            reservationId,
            request.SeatId
            );

        await commandBus.Send(command);

        return(Created("api/Reservations", reservationId));
    }