public async Task TourForwardShouldOpenPlannedTour() { var command = new TourForward { TourId = _testDbFixture.MockedDataInstance.TourForOpenId }; var creationTask = await _rabbitMqFixture.SubscribeAndGetAsync <TourRegistrationOpened>( _testDbFixture.GetTourById, _testDbFixture.MockedDataInstance.TourForOpenId); await _rabbitMqFixture.PublishAsync(command); Tour tour = await creationTask.Task; tour.TourStatus.Should().Be(TourStatus.RegistrationOpened); }
public async Task TourForwardWithDateShouldCreateDbEntity() { string date = DateTime.UtcNow.AddDays(100).ToShortDateString(); int seasonId = 10; var command = new TourForward() { Date = date, SeasonId = seasonId }; var creationTask = await _rabbitMqFixture.SubscribeAndGetAsync <TourCreated>( _testDbFixture.GetTourByDate, date); await _rabbitMqFixture.PublishAsync(command); Tour tour = await creationTask.Task; tour.TourStatus.Should().Be(TourStatus.Planned); tour.SeasonId.Should().Be(seasonId); tour.GuestCount.Should().BeNull(); tour.HomeCount.Should().BeNull(); }
public async Task <IActionResult> Post(TourForward command) { return(await SendAsync(command)); }