Exemple #1
0
        public async Task ShouldCreateTourPackage()
        {
            var listId = await SendAsync(new CreateTourListCommand
            {
                City    = "New York",
                Country = "USA",
                About   = "Lorem Ipsum"
            });

            var command = new CreateTourPackageCommand
            {
                ListId              = listId,
                Name                = "Free Walking Tour New York",
                Duration            = 2,
                Price               = 10,
                InstantConfirmation = true,
                MapLocation         = "Lorem Ipsum",
                WhatToExpect        = "Lorem Ipsum"
            };

            var packageId = await SendAsync(command);

            var package = await FindAsync <TourPackage>(packageId);

            package.Should().NotBeNull();
            package.ListId.Should().Be(command.ListId);
            package.Name.Should().Be(command.Name);
            package.Price.Should().Be(command.Price);
            package.Duration.Should().Be(command.Duration);
            package.InstantConfirmation.Should().Be(command.InstantConfirmation);
            package.MapLocation.Should().Be(command.MapLocation);
            package.WhatToExpect.Should().Be(command.WhatToExpect);
        }
Exemple #2
0
 public async Task <ActionResult <int> > Create(CreateTourPackageCommand command)
 {
     return(await Mediator.Send(command));
 }
Exemple #3
0
        public void ShouldRequireMinimumFields()
        {
            var command = new CreateTourPackageCommand();

            FluentActions.Invoking(() => SendAsync(command)).Should().Throw <ValidationException>();
        }