示例#1
0
        public void CanCreateFormViewModel()
        {
            // Establish Context
            TemplateFormViewModel viewModelToExpect = new TemplateFormViewModel();

            // Act
            TemplateFormViewModel viewModelRetrieved =
                templateManagementService.CreateFormViewModel();

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.Template.ShouldBeNull();
        }
示例#2
0
        public void CanCreateFormViewModelForTemplate()
        {
            // Establish Context
            TemplateFormViewModel viewModelToExpect = new TemplateFormViewModel();

            Template template =
                TemplateInstanceFactory.CreateValidTransientTemplate();

            templateRepository.Expect(r => r.Get(1))
            .Return(template);

            // Act
            TemplateFormViewModel viewModelRetrieved =
                templateManagementService.CreateFormViewModelFor(1);

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.Template.ShouldNotBeNull();
            viewModelRetrieved.Template.ShouldEqual(template);
        }