Пример #1
0
        public async Task Handle_WithAccountId_ShouldReturnEmptyMessagesAsNothingSent()
        {
            var f = new GetCohortsHandlerTestFixtures();

            f.AddEmptyDraftCohortWithEmployer(f.AccountId);

            var response = await f.GetResponse(new GetCohortsQuery(f.AccountId, null));

            Assert.IsNull(response.Cohorts[0].LatestMessageFromEmployer);
            Assert.IsNull(response.Cohorts[0].LatestMessageFromProvider);
        }
Пример #2
0
        public async Task Handle_WithAccountIdWithNoCohorts_ShouldReturnEmptyList()
        {
            var f = new GetCohortsHandlerTestFixtures();

            f.AddEmptyDraftCohortWithEmployer(f.AccountId);

            var response = await f.GetResponse(new GetCohortsQuery(f.NonMatchingId, null));

            Assert.IsNotNull(response);
            Assert.AreEqual(0, response.Cohorts.Length);
        }
Пример #3
0
        public async Task Handle_WithAccountId_ShouldReturnDraftUnapprovedCohortsForThatEmployer()
        {
            var f = new GetCohortsHandlerTestFixtures();

            f.AddEmptyDraftCohortWithEmployer(f.AccountId);

            var response = await f.GetResponse(new GetCohortsQuery(f.AccountId, null));

            Assert.IsNotNull(response);
            Assert.AreEqual(f.SeedCohorts.Count, response.Cohorts.Length);
            Assert.AreEqual(f.AccountId, response.Cohorts[0].AccountId);
            Assert.AreEqual(f.SeedCohorts[0].ProviderId, response.Cohorts[0].ProviderId);
            Assert.AreEqual(f.SeedCohorts[0].Id, response.Cohorts[0].CohortId);
            Assert.AreEqual(f.SeedCohorts[0].CreatedOn, response.Cohorts[0].CreatedOn);
        }