コード例 #1
0
        public void Given_a_review_task_and_no_further_control_measure_tasks_then_CompletionDueDate_is_next_review_date()
        {
            //given
            var expectedCompletionDueDate = new DateTime(2013, 7, 1);
            var riskAss = new HazardousSubstanceRiskAssessment();
            riskAss.AddReview(new RiskAssessmentReview() {Id = 1, CompletionDueDate = DateTime.Now.AddDays(123)});
            riskAss.AddReview(new RiskAssessmentReview() {Id = 2, CompletionDueDate = expectedCompletionDueDate});
            riskAss.AddReview(new RiskAssessmentReview() {Id = 3, CompletionDueDate = DateTime.Now});

            //THEN
            Assert.AreEqual(expectedCompletionDueDate, riskAss.CompletionDueDate.Value);
        }
コード例 #2
0
        public void Given_a_review_task_has_a_completion_due_date_before_the_next_further_control_measure_tasks_then_CompletionDueDate_is_the_next_review_date()
        {
            //given
            var nextFCMCompletionDueDate = new DateTime(2013, 4, 1);
            var nextReviewDate = new DateTime(2013, 3, 4);
            var riskAss = new HazardousSubstanceRiskAssessment();
            riskAss.AddFurtherControlMeasureTask(new HazardousSubstanceRiskAssessmentFurtherControlMeasureTask() { Id = 12312, Deleted = false, TaskCompletionDueDate = DateTime.Now }, null);
            riskAss.AddFurtherControlMeasureTask(new HazardousSubstanceRiskAssessmentFurtherControlMeasureTask() { Id = 1231234, Deleted = false, TaskCompletionDueDate = nextFCMCompletionDueDate }, null);
            riskAss.AddReview(new RiskAssessmentReview() {Id = 2, CompletionDueDate = nextReviewDate});


            //THEN
            Assert.AreEqual(nextReviewDate, riskAss.CompletionDueDate.Value);
        }
コード例 #3
0
 public void Given_a_review_task_has_been_deleted_and_no_further_control_measure_tasks_then_CompletionDueDate_is_null()
 {
     //given
     var riskAss = new HazardousSubstanceRiskAssessment();
     riskAss.AddReview(new RiskAssessmentReview() {Id = 2, CompletionDueDate = DateTime.Now, Deleted = true});
 
     //THEN
     Assert.IsNull(riskAss.CompletionDueDate);
 }