Exemplo n.º 1
0
            public async Task ThenItShouldHaveEnqueuedALearningStandardsSyncJobWithOdsInstanceId()
            {
                // Act
                var _ = await SystemUnderTest.UpdateLearningStandards();

                // Assert
                Func <LearningStandardsJobContext, bool> learningStandardsJobEnqueueVerifier = actual =>
                {
                    actual.ShouldSatisfyAllConditions(
                        () => actual.ApiUrl.ShouldBe(ProductionUrl),
                        () => actual.OdsInstanceId.ShouldBe(_instanceContext.Id)
                        );
                    return(true);
                };

                LearningStandardsJob.Verify(
                    x => x.EnqueueJob(It.Is <LearningStandardsJobContext>(y => learningStandardsJobEnqueueVerifier(y))),
                    Times.Once);
            }
Exemplo n.º 2
0
            public async Task ThenItShouldHaveEnqueuedALearningStandardsSyncJobWithoutYear()
            {
                // Act
                var _ = await SystemUnderTest.LearningStandards(_learningStandardsModel);

                // Assert
                Func <LearningStandardsJobContext, bool> learningStandardsJobEnqueueVerifier = actual =>
                {
                    actual.ShouldSatisfyAllConditions(
                        () => actual.ApiUrl.ShouldBe(ProductionUrl),
                        () => actual.SchoolYear.ShouldBeNull()
                        );
                    return(true);
                };

                LearningStandardsJob.Verify(
                    x => x.EnqueueJob(It.Is <LearningStandardsJobContext>(y => learningStandardsJobEnqueueVerifier(y))),
                    Times.Once);
            }
Exemplo n.º 3
0
            public async Task ThenItShouldHaveEnqueuedALearningStandardsSyncJobWithYear()
            {
                // Act
                var _ = await SystemUnderTest.UpdateLearningStandards();

                // Assert
                Func <LearningStandardsJobContext, bool> learningStandardsJobEnqueueVerifier = actual =>
                {
                    actual.ShouldSatisfyAllConditions(
                        () => actual.Environment.ShouldBe(CloudOdsEnvironment.Production.Value),
                        () => actual.ApiUrl.ShouldBe(ProductionUrl),
                        () => actual.SchoolYear.ShouldBe(Year)
                        );
                    return(true);
                };

                LearningStandardsJob.Verify(
                    x => x.EnqueueJob(It.Is <LearningStandardsJobContext>(y => learningStandardsJobEnqueueVerifier(y))),
                    Times.Once);
            }