예제 #1
0
        public void CanCreateFormViewModel()
        {
            // Establish Context
            var viewModelToExpect = new ApplicationFormViewModel();

            // Act
            ApplicationFormViewModel viewModelRetrieved =
                _applicationManagementService.CreateFormViewModel();

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.Application.ShouldBeNull();
        }
예제 #2
0
        public void CanCreateFormViewModelForApplication()
        {
            // Establish Context
            var viewModelToExpect = new ApplicationFormViewModel();

            Application application =
                ApplicationInstanceFactory.CreateValidTransientApplication();

            _applicationRepository.Expect(r => r.Get(1))
            .Return(application);

            // Act
            ApplicationFormViewModel viewModelRetrieved =
                _applicationManagementService.CreateFormViewModelFor(1);

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.Application.ShouldNotBeNull();
            viewModelRetrieved.Application.ShouldEqual(application);
        }