コード例 #1
0
        public void CanGetSupportTeamSummaries()
        {
            // Establish Context
            IList<SupportTeamDto> supportTeamSummariesToExpect = new List<SupportTeamDto>();

            var supportTeamDto = new SupportTeamDto();
            supportTeamSummariesToExpect.Add(supportTeamDto);

            supportTeamRepository.Expect(r => r.GetSupportTeamSummaries())
                .Return(supportTeamSummariesToExpect);

            // Act
            IList<SupportTeamDto> supportTeamSummariesRetrieved =
                supportTeamManagementService.GetSupportTeamSummaries();

            // Assert
            supportTeamSummariesRetrieved.ShouldNotBeNull();
            supportTeamSummariesRetrieved.Count.ShouldEqual(1);
            supportTeamSummariesRetrieved[0].ShouldNotBeNull();
            supportTeamSummariesRetrieved[0].ShouldEqual(supportTeamDto);
        }
コード例 #2
0
        public void CanListSupportTeams()
        {
            // Establish Context
            var viewModelToExpect = new SearchResultFormViewModel<SupportTeamDto, SupportTeamSearchRequest>();
            viewModelToExpect.PageResultItems = new List<SupportTeamDto>();

            var supportTeamDto = new SupportTeamDto();
            viewModelToExpect.PageResultItems.Add(supportTeamDto);

            supportTeamSearchManagementService.Expect(r => r.CreateFormViewModel())
                .Return(viewModelToExpect);

            // Act
            ViewResult result = supportTeamsController.Index().AssertViewRendered();

            // Assert
            result.ViewData.Model.ShouldNotBeNull();
            (result.ViewData.Model as SearchResultFormViewModel<SupportTeamDto, SupportTeamSearchRequest>).
                ShouldNotBeNull();
            (result.ViewData.Model as SearchResultFormViewModel<SupportTeamDto, SupportTeamSearchRequest>).
                PageResultItems.Count.ShouldBeGreaterThan(0);
        }