Beispiel #1
0
        public void WorkPlacementsConditionMet_False()
        {
            var learningDeliveryWorkPlacements = new TestLearningDeliveryWorkPlacement[]
            {
            };

            NewRule().WorkPlacementsConditionMet(learningDeliveryWorkPlacements).Should().BeFalse();
        }
        public void HasAnyEmpIdNullAndStartDateNotNull_False()
        {
            var learningDeliveryWorkPlacements = new TestLearningDeliveryWorkPlacement[]
            {
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceStartDate     = new DateTime(2018, 10, 01),
                    WorkPlaceEmpIdNullable = 123456789
                },
            };

            NewService().HasAnyEmpIdNullAndStartDateNotNull(learningDeliveryWorkPlacements).Should().BeFalse();
        }
Beispiel #3
0
        public void ConditionMet_True()
        {
            var learningDeliveryWorkPlacements = new TestLearningDeliveryWorkPlacement[]
            {
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceEmpIdNullable = 123,
                    WorkPlaceStartDate     = new DateTime(2018, 10, 11)
                }
            };

            NewRule().ConditionMet(AimTypes.References.ESFLearnerStartandAssessment, learningDeliveryWorkPlacements).Should().BeTrue();
        }
Beispiel #4
0
        public void WorkPlacementsConditionMet_True()
        {
            var learningDeliveryWorkPlacements = new TestLearningDeliveryWorkPlacement[]
            {
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceEmpIdNullable = 123,
                    WorkPlaceStartDate     = new DateTime(2018, 10, 11)
                }
            };

            NewRule().WorkPlacementsConditionMet(learningDeliveryWorkPlacements).Should().BeTrue();
        }
        public void HasAnyWorkPlaceEndDatesGreaterThanLearnActEndDate_FalseNull()
        {
            DateTime?learnActEndDate = null;

            var learningDeliveryWorkPlacements = new TestLearningDeliveryWorkPlacement[]
            {
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceEndDateNullable = null
                },
            };

            NewService().HasAnyWorkPlaceEndDatesGreaterThanLearnActEndDate(learningDeliveryWorkPlacements, learnActEndDate).Should().BeFalse();
        }
Beispiel #6
0
        public void ConditionMet_False(string learnRefNumber, bool includeWorkPlacement)
        {
            var learningDeliveryWorkPlacements = new TestLearningDeliveryWorkPlacement[]
            {
            };
            var learningDeliveryWorkPlacementsWithRecord = new TestLearningDeliveryWorkPlacement[]
            {
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceEmpIdNullable = 123,
                    WorkPlaceStartDate     = new DateTime(2018, 4, 01)
                }
            };

            NewRule().ConditionMet(learnRefNumber, includeWorkPlacement ? learningDeliveryWorkPlacementsWithRecord : learningDeliveryWorkPlacements).Should().BeFalse();
        }
        public void ConditionMet_True()
        {
            var learnActEndDate = new DateTime(2018, 10, 1);

            var learningDeliveryWorkPlacements = new TestLearningDeliveryWorkPlacement[]
            {
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceEndDateNullable = new DateTime(2018, 12, 1)
                },
            };

            var learningDeliveryWorkPlacementQueryServiceMock = new Mock <ILearningDeliveryWorkPlacementQueryService>();

            learningDeliveryWorkPlacementQueryServiceMock
            .Setup(x => x.HasAnyWorkPlaceEndDatesGreaterThanLearnActEndDate(learningDeliveryWorkPlacements, learnActEndDate))
            .Returns(true);

            NewRule(learningDeliveryWorkPlacementQueryServiceMock.Object)
            .ConditionMet(learnActEndDate, learningDeliveryWorkPlacements).Should().BeTrue();
        }
        public void ConditionMet_FalseNull()
        {
            DateTime?learnActEndDate = null;

            var learningDeliveryWorkPlacements = new TestLearningDeliveryWorkPlacement[]
            {
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceEndDateNullable = null
                },
            };

            var learningDeliveryWorkPlacementQueryServiceMock = new Mock <ILearningDeliveryWorkPlacementQueryService>();

            learningDeliveryWorkPlacementQueryServiceMock
            .Setup(x => x.HasAnyWorkPlaceEndDatesGreaterThanLearnActEndDate(learningDeliveryWorkPlacements, learnActEndDate))
            .Returns(false);

            NewRule(learningDeliveryWorkPlacementQueryServiceMock.Object)
            .ConditionMet(learnActEndDate, learningDeliveryWorkPlacements).Should().BeFalse();
        }
        public void HasAnyWorkPlaceEndDatesGreaterThanLearnActEndDate_True()
        {
            DateTime?learnActEndDate = new DateTime(2018, 11, 1);

            var learningDeliveryWorkPlacements = new TestLearningDeliveryWorkPlacement[]
            {
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceEndDateNullable = new DateTime(2018, 10, 1)
                },
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceEndDateNullable = new DateTime(2018, 09, 1)
                },
                new TestLearningDeliveryWorkPlacement()
                {
                    WorkPlaceEndDateNullable = new DateTime(2018, 12, 1)
                },
            };

            NewService().HasAnyWorkPlaceEndDatesGreaterThanLearnActEndDate(learningDeliveryWorkPlacements, learnActEndDate).Should().BeTrue();
        }