Пример #1
0
        public void CanListRequestTypes()
        {
            // Establish Context
            IList <RequestTypeDto> requestTypeSummariesToExpect = new List <RequestTypeDto>();

            var requestTypeDto = new RequestTypeDto();

            requestTypeSummariesToExpect.Add(requestTypeDto);

            _requestTypeManagementService.Expect(r => r.GetRequestTypeSummaries())
            .Return(requestTypeSummariesToExpect);

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

            // Assert
            result.ViewData.Model.ShouldNotBeNull();
            (result.ViewData.Model as IList <RequestTypeDto>).ShouldNotBeNull();
            (result.ViewData.Model as IList <RequestTypeDto>).Count.ShouldEqual(1);
        }
        public void CanGetRequestTypeSummaries()
        {
            // Establish Context
            IList <RequestTypeDto> requestTypeSummariesToExpect = new List <RequestTypeDto>();

            var requestTypeDto = new RequestTypeDto();

            requestTypeSummariesToExpect.Add(requestTypeDto);

            _requestTypeRepository.Expect(r => r.GetRequestTypeSummaries())
            .Return(requestTypeSummariesToExpect);

            // Act
            IList <RequestTypeDto> requestTypeSummariesRetrieved =
                _requestTypeManagementService.GetRequestTypeSummaries();

            // Assert
            requestTypeSummariesRetrieved.ShouldNotBeNull();
            requestTypeSummariesRetrieved.Count.ShouldEqual(1);
            requestTypeSummariesRetrieved[0].ShouldNotBeNull();
            requestTypeSummariesRetrieved[0].ShouldEqual(requestTypeDto);
        }
Пример #3
0
 public async Task <IActionResult> UpdateRequestType(RequestTypeDto model)
 {
     return(Ok(await _requestTypeTypeManagerRepository.EditItem(model)));
 }