コード例 #1
0
        private HeadlineViewModel CreateMockContent()
        {
            var mockedUmbracoContent = new PublishedContentMockingHelper();

            mockedUmbracoContent.AddProperty("header", _testTitle);
            mockedUmbracoContent.AddProperty("body", _testBody);
            return((HeadlineViewModel)_builder.CreateViewModel(mockedUmbracoContent.ContentMock));
        }
コード例 #2
0
        public void WhenCreateViewModelItShouldGetTesMessageFromUmbraco()
        {
            var mockedUmbracoContent = new PublishedContentMockingHelper();
            var testMessage          = "test header";

            mockedUmbracoContent.AddProperty("header", testMessage);

            var viewModel = (ImageSectionViewModel)_builder.CreateViewModel(mockedUmbracoContent.ContentMock);

            Assert.AreEqual(testMessage, viewModel.Header);
        }