Exemple #1
0
        public void OnePrimaryLlddPass()
        {
            LLDDandHealthProblemCollectionRule        lLDDandHealthProblemCollectionRule = new LLDDandHealthProblemCollectionRule();
            List <MessageLearnerLLDDandHealthProblem> firstList = GetMessageLearnerLLDDandHealthProblems(1, "first.xml", 10).ToList();

            firstList.First().PrimaryLLDD = 1;
            List <MessageLearnerLLDDandHealthProblem>         secondList = GetMessageLearnerLLDDandHealthProblems(12, "second.xml", 10).ToList();
            List <List <MessageLearnerLLDDandHealthProblem> > items      = new List <List <MessageLearnerLLDDandHealthProblem> >()
            {
                firstList.ToList(), secondList.ToList()
            };
            var result = lLDDandHealthProblemCollectionRule.Definition(items);

            List <MessageLearnerLLDDandHealthProblem> expectedResult = new List <MessageLearnerLLDDandHealthProblem>();

            expectedResult.AddRange(firstList);
            expectedResult.AddRange(secondList);

            RuleResult <List <MessageLearnerLLDDandHealthProblem> > ruleResultExpected = new RuleResult <List <MessageLearnerLLDDandHealthProblem> >()
            {
                Success          = true,
                AmalgamatedValue = expectedResult.ToList(),
            };

            result.Should().BeEquivalentTo(ruleResultExpected);
        }
Exemple #2
0
        public void LlddCat23Fail()
        {
            LLDDandHealthProblemCollectionRule lLDDandHealthProblemCollectionRule = new LLDDandHealthProblemCollectionRule();
            IEnumerable <MessageLearnerLLDDandHealthProblem>  firstList           = GetMessageLearnerLLDDandHealthProblems(1, "first.xml", 11);
            IEnumerable <MessageLearnerLLDDandHealthProblem>  secondList          = GetMessageLearnerLLDDandHealthProblems(12, "second.xml", 11);
            List <List <MessageLearnerLLDDandHealthProblem> > items = new List <List <MessageLearnerLLDDandHealthProblem> >()
            {
                firstList.ToList(), secondList.ToList()
            };
            var result = lLDDandHealthProblemCollectionRule.Definition(items);

            result.Success.Should().Equals(false);
            result.AmalgamationValidationErrors.Count().Should().Equals(22);
        }
Exemple #3
0
        public void MoreThanOnePrimaryLlddFail()
        {
            LLDDandHealthProblemCollectionRule        lLDDandHealthProblemCollectionRule = new LLDDandHealthProblemCollectionRule();
            List <MessageLearnerLLDDandHealthProblem> firstList = GetMessageLearnerLLDDandHealthProblems(1, "first.xml", 10).ToList();

            firstList[0].PrimaryLLDD = 1;
            List <MessageLearnerLLDDandHealthProblem> secondList = GetMessageLearnerLLDDandHealthProblems(12, "second.xml", 10).ToList();

            secondList.First().PrimaryLLDD = 1;
            List <List <MessageLearnerLLDDandHealthProblem> > items = new List <List <MessageLearnerLLDDandHealthProblem> >()
            {
                firstList.ToList(), secondList.ToList()
            };
            var result = lLDDandHealthProblemCollectionRule.Definition(items);

            result.Success.Should().Equals(false);
            result.AmalgamationValidationErrors.Count().Should().Equals(2);
        }