示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#7
0
        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);
        }
示例#8
0
        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);
 }