private void LoadXaml()
        {
            var loader = new XmlLoader(new DummyParserFactory(RuntimeTypeSource));

            var rootObject = loader.FromString(Xaml);

            Representation = ConvertToViewNodes(rootObject);
        }
示例#2
0
        public void LoadWithRootInstance()
        {
            var dummy = new DummyClass
            {
                AnotherProperty = "Other value",
                SampleProperty = "Will be overwritten"
            };

            var loader = new XmlLoader(new DummyParserFactory(RuntimeTypeSource));

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

            Assert.IsType(dummy.GetType(), actual);
            Assert.Equal("Value", ((DummyClass)actual).SampleProperty);
            Assert.Equal("Other value", ((DummyClass)actual).AnotherProperty);
        }
示例#3
0
        public void LoadWithRootInstance()
        {
            var dummy = new DummyClass
            {
                AnotherProperty = "Other value",
                SampleProperty  = "Will be overwritten"
            };

            var loader = new XmlLoader(new DummyParserFactory(RuntimeTypeSource));

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

            Assert.IsType(dummy.GetType(), actual);
            Assert.Equal("Value", ((DummyClass)actual).SampleProperty);
            Assert.Equal("Other value", ((DummyClass)actual).AnotherProperty);
        }