public void Setup()
        {
            _furtherControlMeasureTask = new HazardousSubstanceRiskAssessmentFurtherControlMeasureTaskDto();

            _viewFurtherControlMeasureTaskViewModel = new ViewFurtherControlMeasureTaskViewModel
                                                          {
                                                              FurtherControlMeasureTaskId = FurtherControlMeasureTaskId,
                                                              Reference = "Test Reference 03",
                                                              Title = "Test Title 03",
                                                              TaskDescription = "Test Description 03",
                                                              TaskStatusId = 99,
                                                              TaskAssignedTo = "Test Name 03",
                                                              TaskAssignedToId = Guid.NewGuid(),
                                                              TaskCompletionDueDate =
                                                                  DateTime.Now.AddDays(20).ToString(
                                                                      CultureInfo.InvariantCulture),
                                                              IsReoccurring = false,
                                                              TaskReoccurringTypeId = (long) TaskReoccurringType.None,
                                                              TaskReoccurringTypes = null,
                                                              TaskReoccurringType = TaskReoccurringType.None,
                                                              TaskReoccurringEndDate = null,
                                                              ExistingDocuments = new ExistingDocumentsViewModel(),
                                                              TaskCompletedDate = null,
                                                              TaskCompletedComments = null,
                                                              TaskCompletedBy = "George Best"
                                                          };

            _furtherControlMeasureTaskService = new Mock<IFurtherControlMeasureTaskService>();

            _furtherControlMeasureTaskService
                .Setup(x => x.GetByIdAndCompanyId(FurtherControlMeasureTaskId, CompanyId))
                .Returns(_furtherControlMeasureTask);

            _viewFurtherControlMeasureTaskViewModelFactory = new Mock<IViewFurtherControlMeasureTaskViewModelFactory>();

            _viewFurtherControlMeasureTaskViewModelFactory
                .Setup(x => x.WithCompanyId(CompanyId))
                .Returns(_viewFurtherControlMeasureTaskViewModelFactory.Object);

            _viewFurtherControlMeasureTaskViewModelFactory
                .Setup(x => x.WithFurtherControlMeasureTaskId(FurtherControlMeasureTaskId))
                .Returns(_viewFurtherControlMeasureTaskViewModelFactory.Object);

            _viewFurtherControlMeasureTaskViewModelFactory
                .Setup(x => x.GetViewModel(_furtherControlMeasureTask))
                .Returns(_viewFurtherControlMeasureTaskViewModel);

        }
        public ViewFurtherControlMeasureTaskViewModel GetViewModel(FurtherControlMeasureTaskDto furtherControlMeasureTask)
        {
            var viewModel = new ViewFurtherControlMeasureTaskViewModel
                       {
                           FurtherControlMeasureTaskId = furtherControlMeasureTask.Id,
                           Reference = furtherControlMeasureTask.Reference,
                           Title = furtherControlMeasureTask.Title,
                           TaskDescription = furtherControlMeasureTask.Description,
                           TaskStatusId = furtherControlMeasureTask.TaskStatusId,
                           TaskAssignedToId =
                               furtherControlMeasureTask.TaskAssignedTo != null
                                   ? furtherControlMeasureTask.TaskAssignedTo.Id
                                   : new Guid(),
                           TaskAssignedTo =
                               furtherControlMeasureTask.TaskAssignedTo != null
                                   ? furtherControlMeasureTask.TaskAssignedTo.FullName
                                   : "",
                           TaskCompletionDueDate = furtherControlMeasureTask.TaskCompletionDueDate,
                           IsReoccurring = furtherControlMeasureTask.IsReoccurring,
                           TaskReoccurringTypeId = (int)furtherControlMeasureTask.TaskReoccurringType,
                           TaskReoccurringType = furtherControlMeasureTask.TaskReoccurringType,
                           TaskReoccurringEndDate = furtherControlMeasureTask.TaskReoccurringEndDate,
                           TaskReoccurringTypes = new TaskReoccurringType().ToSelectList(),
                           TaskCompletedComments = furtherControlMeasureTask.TaskCompletedComments,
                           TaskCompletedDate = furtherControlMeasureTask.TaskCompletedDate.HasValue ? furtherControlMeasureTask.TaskCompletedDate.Value.ToLocalShortDateString() :  null,
                           TaskCompletedBy = furtherControlMeasureTask.TaskCompletedBy != null ? furtherControlMeasureTask.TaskCompletedBy.FullName : string.Empty,
                           DoNotSendTaskNotification = !furtherControlMeasureTask.SendTaskNotification,
                           DoNotSendTaskCompletedNotification =!furtherControlMeasureTask.SendTaskCompletedNotification,
                           DoNotSendTaskOverdueNotification = !furtherControlMeasureTask.SendTaskOverdueNotification,
                           ExistingDocuments = _existingDocumentsViewModelFactory
                                                            .WithCanDeleteDocuments(false)
                                                            .WithDefaultDocumentType(furtherControlMeasureTask.DefaultDocumentType)
                                                            .GetViewModel(furtherControlMeasureTask.Documents)
                       };

            return viewModel;
        }