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.GetClarificationSectionStatus(_outcomes, _sequenceNumber, _sectionNumber);

            Assert.AreEqual(SectionStatus.InProgress, result);
        }
        public void When_Several_Matching_Outcomes_And_All_Pass_Or_Fail_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 = ClarificationPageReviewStatus.Pass
                });
            }

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

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

            Assert.AreEqual(expectedStatus, result);
        }
        public void When_Outcomes_IsEmpty_Returns_Empty()
        {
            _outcomes = new List <ClarificationPageReviewOutcome>();

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

            Assert.IsEmpty(result);
        }
        public void When_Outcomes_IsNull_Then_returns_Empty()
        {
            _outcomes = null;

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

            Assert.IsEmpty(result);
        }
        public void When_Single_Outcome_Returns_Expected_Status(string pageReviewStatus, string expectedStatus)
        {
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = pageReviewStatus, ModeratorReviewStatus = ModeratorPageReviewStatus.Fail
            });
            _outcomes.ForEach(o => o.ModeratorReviewStatus = ModeratorPageReviewStatus.Fail);

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

            Assert.AreEqual(expectedStatus, result);
        }
        public void When_Outcomes_DoNotMatch_Requested_SectionNumber_Returns_Empty()
        {
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber + 1, ModeratorReviewStatus = ModeratorPageReviewStatus.Fail
            });
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber + 2, ModeratorReviewStatus = ModeratorPageReviewStatus.Fail
            });

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

            Assert.IsEmpty(result);
        }
        public void When_Several_Matching_Outcomes_And_All_Empty_Returns_Clarification()
        {
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = string.Empty, ModeratorReviewStatus = ModeratorPageReviewStatus.Fail
            });
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = string.Empty, ModeratorReviewStatus = ModeratorPageReviewStatus.Fail
            });
            _outcomes.Add(new ClarificationPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = string.Empty, ModeratorReviewStatus = ModeratorPageReviewStatus.Fail
            });
            _outcomes.ForEach(o => o.ModeratorReviewStatus = ModeratorPageReviewStatus.Fail);

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

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