Exemplo n.º 1
0
        public void ShouldRequireAbout()
        {
            var command = new CreateTourListCommand
            {
                City    = "Antananarivo",
                Country = "Madagascar",
                About   = ""
            };

            FluentActions.Invoking(() => SendAsync(command)).Should().Throw <ValidationException>();
        }
Exemplo n.º 2
0
        public async Task ShouldCreateTourList()
        {
            var command = new CreateTourListCommand
            {
                City    = "Antananarivo",
                Country = "Madagascar",
                About   = "Lorem Ipsum"
            };

            var id = await SendAsync(command);

            var list = await FindAsync <TourList>(id);

            list.Should().NotBeNull();
            list.City.Should().Be(command.City);
            list.Country.Should().Be(command.Country);
            list.About.Should().Be(command.About);
        }
Exemplo n.º 3
0
        public void ShouldRequireMinimumFields()
        {
            var command = new CreateTourListCommand();

            FluentActions.Invoking(() => SendAsync(command)).Should().Throw <ValidationException>();
        }
 public async Task <ActionResult <int> > Create(CreateTourListCommand command)
 {
     return(await Mediator.Send(command));
 }