public void TestConvertWithAttributeOnType ()
		{
			var node = new ValueNode ("foobar", new MockNameSpaceResolver());
			var bindable = new Bindable ();

			Assert.IsNull (bindable.FooBar);
			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, "FooBar"), node },
				}
			};
			var context = new HydratationContext { RootElement = new Label () };
			rootNode.Accept (new CreateValuesVisitor (context), null);
			node.Accept (new ApplyPropertiesVisitor (context), rootNode);

			Assert.IsNotNull (bindable.FooBar);
			Assert.That (bindable.FooBar, Is.TypeOf<FooBar> ());
			Assert.AreEqual ("foobar", bindable.FooBar.Value);
		}
		public void TestFailOnMissingOrWrongConverter ()
		{
			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);
			Assert.Throws<XamlParseException>(()=> node.Accept (new ApplyPropertiesVisitor (context), rootNode));
		}
		public void TestConvertAttachedBindableProperty ()
		{
			var node = new ValueNode ("qux", new MockNameSpaceResolver());
			var bindable = new Bindable ();

			Assert.IsNull (Bindable.GetQux (bindable));
			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 ("clr-namespace:Xamarin.Forms.Xaml.UnitTests;assembly=Xamarin.Forms.Xaml.UnitTests", "Bindable.Qux"), node },
				}
			};
			var context = new HydratationContext { RootElement = new Label () };
			rootNode.Accept (new CreateValuesVisitor (context), null);
			node.Accept (new ApplyPropertiesVisitor (context), rootNode);
			Assert.IsNotNull (Bindable.GetQux (bindable));
			Assert.That (Bindable.GetQux (bindable), Is.TypeOf<Qux> ());
			Assert.AreEqual ("qux", Bindable.GetQux (bindable).Value);
		}
		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);
		
		}