예제 #1
0
        public void When_Several_Matching_Outcomes_And_Moderation_PassedOrFailed_And_No_Clarification_Process_Returns_Expected_Status(int passOutcomes, int failOutcomes, bool isSectorsSection, string expectedStatus)
        {
            if (isSectorsSection)
            {
                _sequenceNumber = SequenceIds.DeliveringApprenticeshipTraining;
                _sectionNumber  = SectionIds.DeliveringApprenticeshipTraining.YourSectorsAndEmployees;
            }

            for (int p = 0; p < passOutcomes; p++)
            {
                _outcomes.Add(new ClarificationPageReviewOutcome {
                    SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = null, ModeratorReviewStatus = ModeratorPageReviewStatus.Pass
                });
            }

            for (int f = 0; f < failOutcomes; f++)
            {
                _outcomes.Add(new ClarificationPageReviewOutcome {
                    SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = null, ModeratorReviewStatus = ModeratorPageReviewStatus.Fail
                });
            }

            var result = StatusService.GetOutcomeSectionStatus(_outcomes, _sequenceNumber, _sectionNumber);

            Assert.AreEqual(expectedStatus, result);
        }
예제 #2
0
        public void When_Several_Matching_Outcomes_And_Some_Are_InProgress_Returns_InProgress(int passOutcomes, int failOutcomes, int inProgressOutcomes)
        {
            for (int p = 0; p < passOutcomes; p++)
            {
                _outcomes.Add(new ClarificationPageReviewOutcome {
                    SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = ClarificationPageReviewStatus.Pass
                });
            }

            for (int f = 0; f < failOutcomes; f++)
            {
                _outcomes.Add(new ClarificationPageReviewOutcome {
                    SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = ClarificationPageReviewStatus.Fail
                });
            }

            for (int i = 0; i < inProgressOutcomes; i++)
            {
                _outcomes.Add(new ClarificationPageReviewOutcome {
                    SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = ClarificationPageReviewStatus.InProgress
                });
            }

            var result = StatusService.GetOutcomeSectionStatus(_outcomes, _sequenceNumber, _sectionNumber);

            Assert.AreEqual(SectionStatus.InProgress, result);
        }
예제 #3
0
        public void When_Outcomes_IsEmpty_Returns_Empty()
        {
            _outcomes = new List <ClarificationPageReviewOutcome>();

            var result = StatusService.GetOutcomeSectionStatus(_outcomes, _sequenceNumber, _sectionNumber);

            Assert.IsEmpty(result);
        }
예제 #4
0
        public void When_Outcomes_IsNull_Then_returns_Empty()
        {
            _outcomes = null;

            var result = StatusService.GetOutcomeSectionStatus(_outcomes, _sequenceNumber, _sectionNumber);

            Assert.IsEmpty(result);
        }
예제 #5
0
        public void When_Single_Outcome_Returns_Expected_Status(string pageReviewStatus, string expectedStatus)
        {
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = pageReviewStatus
            });

            var result = StatusService.GetOutcomeSectionStatus(_outcomes, _sequenceNumber, _sectionNumber);

            Assert.AreEqual(expectedStatus, result);
        }
예제 #6
0
        public void When_Outcomes_DoNotMatch_Requested_SectionNumber_Returns_Empty()
        {
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber + 1
            });
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber + 2
            });

            var result = StatusService.GetOutcomeSectionStatus(_outcomes, _sequenceNumber, _sectionNumber);

            Assert.IsEmpty(result);
        }
예제 #7
0
        public void When_Several_Matching_Outcomes_And_All_Empty_Returns_Empty()
        {
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = string.Empty
            });
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = string.Empty
            });
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = string.Empty
            });

            var result = StatusService.GetOutcomeSectionStatus(_outcomes, _sequenceNumber, _sectionNumber);

            Assert.IsEmpty(result);
        }
예제 #8
0
        public void When_Several_Matching_Outcomes_And_All_Pass_Returns_Pass()
        {
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = ClarificationPageReviewStatus.Pass
            });
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = ClarificationPageReviewStatus.Pass
            });
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = ClarificationPageReviewStatus.Pass
            });

            var result = StatusService.GetOutcomeSectionStatus(_outcomes, _sequenceNumber, _sectionNumber);

            Assert.AreEqual(SectionStatus.Pass, result);
        }