public async Task ItineraryDoesNotExist_ReturnsNull() { var query = new ItineraryDetailQuery(); var handler = new ItineraryDetailQueryHandler(Context, Mock.Of <IMediator>()); var result = await handler.Handle(query); Assert.Null(result); }
public async Task ItineraryQueryLoadsCampaignName() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of <IMediator>()); var result = await handler.Handle(query); Assert.Equal("Neighborhood Fire Prevention Days", result.CampaignName); }
public async Task ItineraryQueryLoadsOrganizationId() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of <IMediator>()); var result = await handler.Handle(query); Assert.Equal(1, result.OrganizationId); }
public async Task ItineraryQueryLoadsEventDetails() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of <IMediator>()); var result = await handler.Handle(query); Assert.Equal("Queen Anne Fire Prevention Day", result.EventName); }
public async Task ItineraryQueryLoadsRequests() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of <IMediator>()); var result = await handler.Handle(query); Assert.Equal(1, result.Requests.Count); Assert.Equal("Request 1", result.Requests[0].Name); }
public async Task ItineraryQueryLoadsTeamMembers() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of <IMediator>()); var result = await handler.Handle(query); Assert.Equal(1, result.TeamMembers.Count); Assert.Equal("*****@*****.**", result.TeamMembers[0].VolunteerEmail); }
public async Task ItineraryQueryLoadsItineraryDetails() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of <IMediator>()); var result = await handler.Handle(query); Assert.Equal(1, result.Id); Assert.Equal("1st Itinerary", result.Name); Assert.Equal(new DateTime(2016, 07, 01), result.Date); }
public async Task ItineraryQueryLoadsTeamMembers() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of <IMediator>()); var result = await handler.Handle(query); Assert.Equal(3, result.TeamMembers.Count); // Team lead is first Assert.True(result.TeamMembers[0].IsTeamLead); // then ordered by LastName and FirstName Assert.Equal("Gordon, Steve", result.TeamMembers[1].DisplayName); Assert.Equal("Jones, Carol", result.TeamMembers[2].DisplayName); }
public async Task ItineraryQueryLoadsRequests() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of<IMediator>()); var result = await handler.Handle(query); Assert.Equal(1, result.Requests.Count); Assert.Equal("Request 1", result.Requests[0].Name); }
public async Task ItineraryQueryLoadsTeamMembers() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of<IMediator>()); var result = await handler.Handle(query); Assert.Equal(1, result.TeamMembers.Count); Assert.Equal("*****@*****.**", result.TeamMembers[0].VolunteerEmail); }
public async Task ItineraryQueryLoadsCampaignName() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of<IMediator>()); var result = await handler.Handle(query); Assert.Equal("Neighborhood Fire Prevention Days", result.CampaignName); }
public async Task ItineraryQueryLoadsOrganizationId() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of<IMediator>()); var result = await handler.Handle(query); Assert.Equal(1, result.OrganizationId); }
public async Task ItineraryQueryLoadsEventDetails() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of<IMediator>()); var result = await handler.Handle(query); Assert.Equal("Queen Anne Fire Prevention Day", result.EventName); }
public async Task ItineraryQueryLoadsItineraryDetails() { var query = new ItineraryDetailQuery { ItineraryId = 1 }; var handler = new ItineraryDetailQueryHandler(Context, Mock.Of<IMediator>()); var result = await handler.Handle(query); Assert.Equal(1, result.Id); Assert.Equal("1st Itinerary", result.Name); Assert.Equal(new DateTime(2016, 07, 01), result.Date); }
public async Task ItineraryDoesNotExist_ReturnsNull() { var query = new ItineraryDetailQuery(); var handler = new ItineraryDetailQueryHandler(Context, Mock.Of<IMediator>()); var result = await handler.Handle(query); Assert.Null(result); }