public void ShouldRequireAbout() { var command = new CreateTourListCommand { City = "Antananarivo", Country = "Madagascar", About = "" }; FluentActions.Invoking(() => SendAsync(command)).Should().Throw <ValidationException>(); }
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); }
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)); }