コード例 #1
0
        public void ActivityDoesNotExist()
        {
            var context = ServiceProvider.GetService <AllReadyContext>();
            var query   = new ActivityDetailForNotificationQuery {
                ActivityId = 999, UserId = _user1.Id
            };
            var handler = new ActivityDetailForNotificationQueryHandler(context);
            var result  = handler.Handle(query);

            Assert.Null(result);
        }
コード例 #2
0
        public void ModelCanBeCreatedFomExistingActivity()
        {
            var context = ServiceProvider.GetService <AllReadyContext>();
            var query   = new ActivityDetailForNotificationQuery {
                ActivityId = 1, UserId = _user1.Id
            };
            var handler = new ActivityDetailForNotificationQueryHandler(context);
            var result  = handler.Handle(query);

            Assert.NotNull(result);
            Assert.True(_queenAnne.UsersSignedUp.Count == result.UsersSignedUp.Count, "Count of signed up users does not match");
            Assert.True(_queenAnne.Tasks.Count == result.Tasks.Count, "Count of tasks does not match");
            Assert.True(_queenAnne.Tasks[0].AssignedVolunteers.Count == result.Tasks[0].AssignedVolunteers.Count, "Count of volunteers assigned to tak does not match");
            Assert.True(_firePrev.CampaignContacts.Count == result.CampaignContacts.Count, "Count of campaign contacts does not match");
        }
コード例 #3
0
 public void ActivityDoesNotExist()
 {
     var context = ServiceProvider.GetService<AllReadyContext>();
     var query = new ActivityDetailForNotificationQuery { ActivityId = 999 };
     var handler = new ActivityDetailForNotificationQueryHandler(context);
     var result = handler.Handle(query);
     Assert.Null(result);
 }
コード例 #4
0
 public void ModelCanBeCreatedFomExistingActivity()
 {
     var context = ServiceProvider.GetService<AllReadyContext>();
     var query = new ActivityDetailForNotificationQuery { ActivityId = 1 };
     var handler = new ActivityDetailForNotificationQueryHandler(context);
     var result = handler.Handle(query);
     Assert.NotNull(result);
     Assert.True(_queenAnne.UsersSignedUp.Count == result.UsersSignedUp.Count, "Count of signed up users does not match");
     Assert.True(_queenAnne.Tasks.Count == result.Tasks.Count, "Count of tasks does not match");
     Assert.True(_queenAnne.Tasks[0].AssignedVolunteers.Count == result.Tasks[0].AssignedVolunteers.Count, "Count of volunteers assigned to tak does not match");
     Assert.True(_firePrev.CampaignContacts.Count == result.CampaignContacts.Count, "Count of campaign contacts does not match");
 }