コード例 #1
0
        public void CanGetRequestEstimateSummaries()
        {
            // Establish Context
            IList<RequestEstimateDto> requestEstimateSummariesToExpect = new List<RequestEstimateDto>();

            var requestEstimateDto = new RequestEstimateDto();
            requestEstimateSummariesToExpect.Add(requestEstimateDto);

            _requestEstimateRepository.Expect(r => r.GetRequestEstimateSummaries())
                .Return(requestEstimateSummariesToExpect);

            // Act
            IList<RequestEstimateDto> requestEstimateSummariesRetrieved =
                _requestEstimateManagementService.GetRequestEstimateSummaries();

            // Assert
            requestEstimateSummariesRetrieved.ShouldNotBeNull();
            requestEstimateSummariesRetrieved.Count.ShouldEqual(1);
            requestEstimateSummariesRetrieved[0].ShouldNotBeNull();
            requestEstimateSummariesRetrieved[0].ShouldEqual(requestEstimateDto);
        }
コード例 #2
0
        public void CanListRequestEstimates()
        {
            // Establish Context
            IList<RequestEstimateDto> requestEstimateSummariesToExpect = new List<RequestEstimateDto>();

            var requestEstimateDto = new RequestEstimateDto();
            requestEstimateSummariesToExpect.Add(requestEstimateDto);

            _requestEstimateManagementService.Expect(r => r.GetRequestEstimateSummaries())
                .Return(requestEstimateSummariesToExpect);

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

            // Assert
            result.ViewData.Model.ShouldNotBeNull();
            (result.ViewData.Model as IList<RequestEstimateDto>).ShouldNotBeNull();
            (result.ViewData.Model as IList<RequestEstimateDto>).Count.ShouldEqual(1);
        }