public void TestNotInListFail(string famType, int occurrences)
        {
            var learnerFAMAmalgamationRule = new LearnerFAMAmalgamationRule();

            var famsOne = GetFam("ILR-99999999-2021-20200704-092701-05.xml", famType, occurrences);
            var famsTwo = GetFam("ILR-99999999-2021-20200704-092701-06.xml", famType, occurrences);

            IEnumerable <List <MessageLearnerLearnerFAM> > fams = new List <List <MessageLearnerLearnerFAM> >()
            {
                famsOne,
                famsTwo,
            };

            var result = learnerFAMAmalgamationRule.Definition(fams);

            result.AmalgamatedValue.Should().HaveCount(0);
        }
        public void TestEachFamtypeInIsolationFail(string famType, int occurrences)
        {
            var learnerFAMAmalgamationRule = new LearnerFAMAmalgamationRule();

            var famsOne = GetFam("ILR-99999999-2021-20200704-092701-05.xml", famType, occurrences + 1);
            var famsTwo = GetFam("ILR-99999999-2021-20200704-092701-06.xml", famType, occurrences + 1);

            IEnumerable <List <MessageLearnerLearnerFAM> > fams = new List <List <MessageLearnerLearnerFAM> >()
            {
                famsOne.ToList(),
                                                           famsTwo.ToList(),
            };

            var result = learnerFAMAmalgamationRule.Definition(fams);

            result.AmalgamatedValue.Should().HaveCount(0);
            result.AmalgamationValidationErrors.Should().HaveCount((occurrences + 1) * 2);
        }
        public void TestEachFamtypeInIsolationPass(string famType, int occurrences)
        {
            var learnerFAMAmalgamationRule = new LearnerFAMAmalgamationRule();

            var famsOne = GetFam("ILR-99999999-2021-20200704-092701-05.xml", famType, occurrences);
            var famsTwo = GetFam("ILR-99999999-2021-20200704-092701-06.xml", famType, occurrences);

            IEnumerable <List <MessageLearnerLearnerFAM> > fams = new List <List <MessageLearnerLearnerFAM> >()
            {
                famsOne.ToList(),
                                                           famsTwo.ToList(),
            };

            var result = learnerFAMAmalgamationRule.Definition(fams);

            result.AmalgamatedValue.Should().HaveCount(occurrences);

            result.AmalgamatedValue.Where(x => x.LearnFAMType.Equals(famType, StringComparison.OrdinalIgnoreCase)).Should().HaveCount(occurrences);
        }
        public void AlwaysTrue()
        {
            var learnerFAMAmalgamationRule = new LearnerFAMAmalgamationRule();

            var famsOne = GetAllValidFams("ILR-99999999-2021-20200704-092701-05.xml");
            var famsTwo = GetAllValidFams("ILR-99999999-2021-20200704-092701-06.xml");

            IEnumerable <List <MessageLearnerLearnerFAM> > fams = new List <List <MessageLearnerLearnerFAM> >()
            {
                famsOne, famsTwo,
            };

            var result = learnerFAMAmalgamationRule.Definition(fams);

            result.AmalgamatedValue.Should().HaveCount(15);

            foreach (var famType in famTypesMaxOccurenceDictionary)
            {
                result.AmalgamatedValue.Where(x => x.LearnFAMType.Equals(famType.Key, StringComparison.OrdinalIgnoreCase)).Should().HaveCount(famType.Value);
            }
        }