コード例 #1
0
        public void CanCreateFormViewModel()
        {
            // Establish Context
            var viewModelToExpect = new RequestTypeFormViewModel();

            // Act
            RequestTypeFormViewModel viewModelRetrieved =
                _requestTypeManagementService.CreateFormViewModel();

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.RequestType.ShouldBeNull();
        }
コード例 #2
0
        public void CanCreateFormViewModelForRequestType()
        {
            // Establish Context
            var viewModelToExpect = new RequestTypeFormViewModel();

            RequestType requestType =
                RequestTypeInstanceFactory.CreateValidTransientRequestType();

            _requestTypeRepository.Expect(r => r.Get(1))
            .Return(requestType);

            // Act
            RequestTypeFormViewModel viewModelRetrieved =
                _requestTypeManagementService.CreateFormViewModelFor(1);

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.RequestType.ShouldNotBeNull();
            viewModelRetrieved.RequestType.ShouldEqual(requestType);
        }