public async Task SetsTeamLead_WhenNoPriorTeamLead()
        {
            var sut = new SetTeamLeadCommandHandler(Context);

            await sut.Handle(new SetTeamLeadCommand(1, 1));

            Context.VolunteerTaskSignups.Any(x => x.IsTeamLead && x.ItineraryId == 1).ShouldBeTrue();
        }
        public async Task ReturnsSuccessResult_WhenTeamLeadChanged()
        {
            var sut = new SetTeamLeadCommandHandler(Context);

            var result = await sut.Handle(new SetTeamLeadCommand(1, 1));

            result.ShouldBe(SetTeamLeadResult.Success);
        }
        public async Task ReturnsFailureResult_WhenVolunteerTaskIdNotFound()
        {
            var sut = new SetTeamLeadCommandHandler(Context);

            var result = await sut.Handle(new SetTeamLeadCommand(1, 400));

            result.ShouldBe(SetTeamLeadResult.VolunteerTaskSignupNotFound);
        }
        public async Task ReturnsFailureResult_WhenVolunteerTaskIdNotFound()
        {
            var mockMediator = new Mock <IMediator>();

            var sut          = new SetTeamLeadCommandHandler(Context, mockMediator.Object);
            var itineraryUrl = "https://localhost/Admin/Itinerary/Details/1";

            var result = await sut.Handle(new SetTeamLeadCommand(1, 400, itineraryUrl));

            result.ShouldBe(SetTeamLeadResult.VolunteerTaskSignupNotFound);
        }
        public async Task ReturnsSuccessResult_WhenTeamLeadChanged()
        {
            var mockMediator = new Mock <IMediator>();

            var sut          = new SetTeamLeadCommandHandler(Context, mockMediator.Object);
            var itineraryUrl = "https://localhost/Admin/Itinerary/Details/1";

            var result = await sut.Handle(new SetTeamLeadCommand(1, 1, itineraryUrl));

            result.ShouldBe(SetTeamLeadResult.Success);
        }
        public async Task SetsTeamLead_WhenNoPriorTeamLead()
        {
            var mockMediator = new Mock <IMediator>();

            var sut          = new SetTeamLeadCommandHandler(Context, mockMediator.Object);
            var itineraryUrl = "https://localhost/Admin/Itinerary/Details/1";

            await sut.Handle(new SetTeamLeadCommand(1, 1, itineraryUrl));

            Context.VolunteerTaskSignups.Any(x => x.IsTeamLead && x.ItineraryId == 1).ShouldBeTrue();
        }
        public async Task ReplacesTeamLead_WhenPriorTeamLead()
        {
            var sut = new SetTeamLeadCommandHandler(Context);

            await sut.Handle(new SetTeamLeadCommand(2, 3));

            Context.VolunteerTaskSignups.Count(x => x.IsTeamLead && x.ItineraryId == 2).ShouldBe(1);

            var teamLead = Context.VolunteerTaskSignups.FirstOrDefault(x => x.IsTeamLead);

            teamLead.Id.ShouldBe(3);
        }
        public async Task ReplacesTeamLead_WhenPriorTeamLead()
        {
            var mockMediator = new Mock <IMediator>();

            var sut          = new SetTeamLeadCommandHandler(Context, mockMediator.Object);
            var itineraryUrl = "https://localhost/Admin/Itinerary/Details/2";

            await sut.Handle(new SetTeamLeadCommand(2, 3, itineraryUrl));

            Context.VolunteerTaskSignups.Count(x => x.IsTeamLead && x.ItineraryId == 2).ShouldBe(1);

            var teamLead = Context.VolunteerTaskSignups.FirstOrDefault(x => x.IsTeamLead);

            teamLead.Id.ShouldBe(3);
        }