public void ConditionMetMeetsExpectation(string learnFamType, int learnFamCode, bool lookUpResult, bool expectation)
        {
            var lookupsMock = new Mock <IProvideLookupDetails>();

            lookupsMock
            .Setup(l => l.Contains(TypeOfLimitedLifeLookup.LearnFAMType, $"{learnFamType}{learnFamCode}"))
            .Returns(lookUpResult);

            var testLearnerFam = new TestLearnerFAM {
                LearnFAMType = learnFamType, LearnFAMCode = learnFamCode
            };

            NewRule(lookupsMock.Object).ConditionMet(testLearnerFam).Should().Be(expectation);
        }
Exemplo n.º 2
0
        public void GetLearningDeliveryFAMsCountByFAMType_CountCheckForNotFound()
        {
            var testLearningFAMs = new TestLearnerFAM[]
            {
                new TestLearnerFAM
                {
                    LearnFAMType = LearnerFAMTypeConstants.EHC
                },
                new TestLearnerFAM
                {
                    LearnFAMType = LearnerFAMTypeConstants.HNS
                },
                new TestLearnerFAM
                {
                    LearnFAMType = LearnerFAMTypeConstants.DLA
                },
            };

            NewService().GetLearnerFAMsCountByFAMType(testLearningFAMs, LearnerFAMTypeConstants.FME).Should().Be(0);
        }
Exemplo n.º 3
0
        public void ConditionMet_False()
        {
            var famType    = "DLA";
            var famCode    = 2;
            var learnerFam = new TestLearnerFAM
            {
                LearnFAMType = famType,
                LearnFAMCode = famCode
            };

            var dd06Date = new DateTime(2018, 08, 01);

            var lookupDetailsMock = new Mock <IProvideLookupDetails>();

            lookupDetailsMock
            .Setup(ldm => ldm.IsCurrent(TypeOfLimitedLifeLookup.LearnerFAM, $"{famType}{famCode}", dd06Date))
            .Returns(true);

            NewRule(lookupDetails: lookupDetailsMock.Object).ConditionMet(learnerFam, dd06Date).Should().BeFalse();
        }
Exemplo n.º 4
0
        private ILearnerFAM[] SetupLearnerFams()
        {
            var learnerFams = new TestLearnerFAM[]
            {
                new TestLearnerFAM()
                {
                    LearnFAMType = "famA", LearnFAMCode = 1
                },
                new TestLearnerFAM()
                {
                    LearnFAMType = "FAmB", LearnFAMCode = 2
                },
                new TestLearnerFAM()
                {
                    LearnFAMType = "FaMC", LearnFAMCode = 3
                },
                new TestLearnerFAM()
                {
                    LearnFAMType = "FAmc", LearnFAMCode = 5
                },
            };

            return(learnerFams);
        }