public void ProcessorContext_Resolves_Nested_Context()
        {
            var value   = "Test";
            var content = new MockPublishedContent();
            var context = new MyProcessorContext {
                MyContextProperty = value
            };

            var model = content.As <MyValueResolverModel>(processorContexts: new[] { context });

            Assert.That(model.MyNestedProperty, Is.Not.Null);
            Assert.That(model.MyNestedProperty.MyProperty, Is.EqualTo(model.MyProperty));
        }
예제 #2
0
        public void ProcessorContext_Resolves()
        {
            var content = new PublishedContentMock();
            var context = new MyProcessorContext
            {
                MyContextProperty = "Test"
            };

            var model = content.As <MyValueResolverModel>(processorContexts: new[] { context });

            Assert.That(model.MyProperty, Is.EqualTo("Test"));
            Assert.That(model.MyLazyProperty, Is.EqualTo(model.MyProperty));
        }