Beispiel #1
0
        public void TestSetPropertyWithoutConverter()
        {
            var baz      = new Baz();
            var node     = new ValueNode(baz, new MockNameSpaceResolver());
            var bindable = new Bindable();

            Assert.IsNull(bindable.Baz);
            var rootNode = new XamlLoader.RuntimeRootNode(new XmlType("clr-namespace:Xamarin.Forms.Xaml.UnitTests;assembly=Xamarin.Forms.Xaml.UnitTests", "Bindable", null), bindable, null)
            {
                Properties =
                {
                    { new XmlName(null, "Baz"), node },
                }
            };
            var context = new HydrationContext {
                RootElement = new Label()
            };

            rootNode.Accept(new CreateValuesVisitor(context), null);
            node.Accept(new ApplyPropertiesVisitor(context), rootNode);
            Assert.AreEqual(baz, bindable.Baz);
        }
		public void TestSetPropertyWithoutConverter ()
		{
			var baz = new Baz ();
			var node = new ValueNode (baz, new MockNameSpaceResolver());
			var bindable = new Bindable ();

			Assert.IsNull (bindable.Baz);
			var rootNode = new XamlLoader.RuntimeRootNode (new XmlType("clr-namespace:Xamarin.Forms.Xaml.UnitTests;assembly=Xamarin.Forms.Xaml.UnitTests","Bindable",null), bindable, null) {
				Properties = {
					{ new XmlName (null, "Baz"), node },
				}
			};
			var context = new HydratationContext { RootElement = new Label () };
			rootNode.Accept (new CreateValuesVisitor(context), null);
			node.Accept (new ApplyPropertiesVisitor (context), rootNode);
			Assert.AreEqual (baz, bindable.Baz);
		
		}