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

            // Act
            HostFormViewModel viewModelRetrieved =
                _hostManagementService.CreateFormViewModel();

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

            Host host =
                HostInstanceFactory.CreateValidTransientHost();

            _hostRepository.Expect(r => r.Get(1))
            .Return(host);

            // Act
            HostFormViewModel viewModelRetrieved =
                _hostManagementService.CreateFormViewModelFor(1);

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.Host.ShouldNotBeNull();
            viewModelRetrieved.Host.ShouldEqual(host);
        }