public void When_Outcomes_IsNull_Then_returns_Empty()
        {
            _outcomes = null;

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

            Assert.IsEmpty(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_Single_Outcome_Returns_Expected_Status(string pageReviewStatus, string expectedStatus)
        {
            _outcomes.Add(new ModeratorPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = pageReviewStatus
            });

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

            Assert.AreEqual(expectedStatus, 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 ModeratorPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber + 1
            });
            _outcomes.Add(new ModeratorPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber + 2
            });

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

            Assert.IsEmpty(result);
        }
        public void When_Several_Matching_Outcomes_And_All_Empty_Returns_Empty()
        {
            _outcomes.Add(new ModeratorPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = string.Empty
            });
            _outcomes.Add(new ModeratorPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = string.Empty
            });
            _outcomes.Add(new ModeratorPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = string.Empty
            });

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

            Assert.IsEmpty(result);
        }
        public void When_Several_Matching_Outcomes_And_All_Pass_Returns_Pass()
        {
            _outcomes.Add(new ModeratorPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = ModeratorPageReviewStatus.Pass
            });
            _outcomes.Add(new ModeratorPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = ModeratorPageReviewStatus.Pass
            });
            _outcomes.Add(new ModeratorPageReviewOutcome {
                SequenceNumber = _sequenceNumber, SectionNumber = _sectionNumber, Status = ModeratorPageReviewStatus.Pass
            });

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

            Assert.AreEqual(SectionStatus.Pass, 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);
        }