Ejemplo n.º 1
0
        public SearchResultFormViewModel <ApplicationDto, ApplicationSearchRequest> CreateFormViewModel()
        {
            var searchRequest = new ApplicationSearchRequest
            {
                //Supervisors = _applicationRepository.GetActiveSupervisors(-1,"LastName", "Asc")
                Hosts        = _hostManagementService.GetAll(),
                SupportTeams = _supportTeamManagementService.GetAll()
            };
            SearchResultFormViewModel <ApplicationDto, ApplicationSearchRequest> viewModel = Search(searchRequest);

            viewModel.SearchRequest = searchRequest;
            return(viewModel);
        }
Ejemplo n.º 2
0
        protected void LoadViewModel(ApplicationFormViewModel viewModel)
        {
            viewModel.SubjectMatterExperts = (viewModel.Application != null &&
                                              viewModel.Application.SubjectMatterExpertId.HasValue)
                                        ? _personManagementService.GetActiveStaff(viewModel.Application.SubjectMatterExpertId.Value)
                                        : _personManagementService.GetActiveStaff();

            viewModel.Hosts        = _hostManagementService.GetAll();
            viewModel.SupportTeams = _supportTeamManagementService.GetAll();
        }
Ejemplo n.º 3
0
        public void CanGetAllSupportTeams()
        {
            // Establish Context
            IList <SupportTeam> supportTeamsToExpect = new List <SupportTeam>();

            SupportTeam supportTeam =
                SupportTeamInstanceFactory.CreateValidTransientSupportTeam();

            supportTeamsToExpect.Add(supportTeam);

            supportTeamRepository.Expect(r => r.GetAll(Arg <string> .Is.Anything, Arg <string> .Is.Anything))
            .Return(supportTeamsToExpect);

            // Act
            IList <SupportTeam> supportTeamsRetrieved =
                supportTeamManagementService.GetAll();

            // Assert
            supportTeamsRetrieved.ShouldNotBeNull();
            supportTeamsRetrieved.Count.ShouldEqual(1);
            supportTeamsRetrieved[0].ShouldNotBeNull();
            supportTeamsRetrieved[0].ShouldEqual(supportTeam);
        }