Пример #1
0
        public void CanCreateFormViewModel()
        {
            // Establish Context
            var viewModelToExpect = new RequestFormViewModel();

            // Act
            RequestFormViewModel viewModelRetrieved =
                _requestManagementService.CreateFormViewModel();

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.Request.ShouldBeNull();
        }
Пример #2
0
        public void CanCreateFormViewModelForRequest()
        {
            // Establish Context
            var viewModelToExpect = new RequestFormViewModel();

            Request request =
                RequestInstanceFactory.CreateValidTransientRequest();

            _requestRepository.Expect(r => r.Get(1))
            .Return(request);

            // Act
            RequestFormViewModel viewModelRetrieved =
                _requestManagementService.CreateFormViewModelFor(1);

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.Request.ShouldNotBeNull();
            viewModelRetrieved.Request.ShouldEqual(request);
        }