コード例 #1
0
ファイル: SpecialTests.cs プロジェクト: danwalmsley/OmniXAML
        public void LoadWithRootInstance()
        {
            var dummy = new DummyClass
            {
                AnotherProperty = "Other value",
                SampleProperty = "Will be overwritten"
            };

            var loader = new XamlStreamLoader(new SuperProtoParser(WiringContext),
                new XamlNodesPullParser(WiringContext),
                new DefaultObjectAssemblerFactory(WiringContext));

            var actual = loader.Load("<DummyClass xmlns=\"root\" SampleProperty=\"Value\" />", dummy);

            Assert.IsInstanceOfType(actual, dummy.GetType());
            Assert.AreEqual("Value", ((DummyClass)actual).SampleProperty);
            Assert.AreEqual("Other value", ((DummyClass)actual).AnotherProperty);
        }
コード例 #2
0
 protected GivenAXamlXmlLoader()
 {
     XamlStreamLoader = new XamlStreamLoader(new SuperProtoParser(WiringContext),
         new XamlNodesPullParser(WiringContext),
         new DefaultObjectAssemblerFactory(WiringContext));
 }