public void Given_not_showing_archived_tasks_When_IsShowOutsandingVisible_Then_is_true()
        {
            // Given
            var target = new SearchRiskAssessmentsViewModel
            {
                IsShowArchived = false
            };

            // When
            var result = target.IsShowOpenVisible();

            // Then
            Assert.IsFalse(result);
        }
        public void Given_showing_deleted_tasks_When_IsShowOutsandingVisible_Then_is_true()
        {
            // Given
            var target = new SearchRiskAssessmentsViewModel
                             {
                                 IsShowDeleted = true
                             };

            // When
            var result = target.IsShowOpenVisible();

            // Then
            Assert.IsTrue(result);
        }
 private SearchRiskAssessmentsViewModel CreateFireRiskAssessmentsViewModel(
     IEnumerable<FireRiskAssessmentDto> riskAssessments,
     IEnumerable<SiteGroupDto> siteGroups,
     IEnumerable<SiteDto> sites,
     int count)
 {
     var viewModel = new SearchRiskAssessmentsViewModel
                     {
                         CompanyId = _companyId,
                         CreatedFrom = _createdFrom,
                         CreatedTo = _createdTo,
                         SiteGroups = siteGroups.Select(AutoCompleteViewModel.ForSiteGroup).AddDefaultOption(),
                         Sites = sites != null
                             ? sites.OrderBy(x => x.Name).Select(AutoCompleteViewModel.ForSite).AddDefaultOption()
                             : new List<AutoCompleteViewModel>(),
                         IsShowDeleted = _showDeleted,
                         IsShowArchived = _showArchived,
                         RiskAssessments = riskAssessments.Select(ra => new SearchRiskAssessmentResultViewModel()
                                                                        {
                                                                            Id = ra.Id,
                                                                            Reference = ra.Reference,
                                                                            Title = ra.Title,
                                                                            Site =
                                                                                ra.RiskAssessmentSite != null
                                                                                    ? ra.RiskAssessmentSite.Name
                                                                                    : string.Empty,
                                                                            AssignedTo =
                                                                                ra.RiskAssessor != null
                                                                                    ? ra.RiskAssessor.FormattedName
                                                                                    : string.Empty,
                                                                            Status = ra.Status.ToString(),
                                                                            AssessmentDate = ra.AssessmentDate,
                                                                            NextReviewDate = ra.NextReviewDate,
                                                                            IsDeleted = ra.Deleted
                                                                        }).ToList(),
                         PageSize = _pageSize,
                         Total = count,
                         MultiSelectSites = sites != null
                             ? sites.OrderBy(x => x.Name).Select(x => new SiteMultiSelectViewModel() { Id = x.Id, Name = x.Name })
                             : new List<SiteMultiSelectViewModel>()
                     };
     
     return viewModel;
 }
        public void Given_showing_deleted_When_GetAdditionalTitle_Then_return_Deleted()
        {
            // Given
            var target = new SearchRiskAssessmentsViewModel
            {
                IsShowDeleted = true
            };

            // When
            var result = target.GetAdditionalTitle();

            // Then
            Assert.That(result.ToString(), Is.EqualTo("<strong>Deleted</strong>"));
        }
        public void Given_not_showing_archived_and_not_showing_deleted_When_GetAdditionalTitle_Then_return_Open()
        {
            // Given
            var target = new SearchRiskAssessmentsViewModel
            {
                IsShowArchived = false,
                IsShowDeleted = false
            };

            // When
            var result = target.GetAdditionalTitle();

            // Then
            Assert.That(result.ToString(), Is.EqualTo("<strong>Open</strong>"));
        }