Esempio n. 1
0
        public void GetAllAttachableMembers()
        {
            var xt = new XamlType(typeof(AttachableClass), sctx);
            var l  = xt.GetAllAttachableMembers();

            Assert.AreEqual(0, l.Count, "#1");
        }
Esempio n. 2
0
        public void AttachablePropertySetValueNullObject()
        {
            var xt  = new XamlType(typeof(Attachable), sctx);
            var apl = xt.GetAllAttachableMembers();
            var foo = apl.First(ap => ap.Name == "Foo");

            Assert.IsTrue(foo.IsAttachable, "#7");
            Assert.Throws <ArgumentNullException> (() => foo.Invoker.SetValue(null, "xxx"));
        }
Esempio n. 3
0
        public void AttachablePropertySetValueSuccess()
        {
            var xt  = new XamlType(typeof(Attachable), sctx);
            var apl = xt.GetAllAttachableMembers();
            var foo = apl.First(ap => ap.Name == "Foo");

            Assert.IsTrue(foo.IsAttachable, "#7");
            var obj = new object();

            foo.Invoker.SetValue(obj, "xxx");              // obj is non-null, so valid.
            // FIXME: this line should be unnecessary.
            AttachablePropertyServices.RemoveProperty(obj, new AttachableMemberIdentifier(foo.Type.UnderlyingType, foo.Name));
        }
Esempio n. 4
0
        public void AttachableProperty()
        {
            var xt  = new XamlType(typeof(Attachable), sctx);
            var apl = xt.GetAllAttachableMembers();

            Assert.IsTrue(apl.Any(ap => ap.Name == "Foo"), "#1");
            Assert.IsTrue(apl.Any(ap => ap.Name == "Protected"), "#2");
            // oh? SetBaz() has non-void return value, but it seems ignored.
            Assert.IsTrue(apl.Any(ap => ap.Name == "Baz"), "#3");
            Assert.AreEqual(4, apl.Count, "#4");
            Assert.IsTrue(apl.All(ap => ap.IsAttachable), "#5");
            var x = apl.First(ap => ap.Name == "X");

            Assert.IsTrue(x.IsEvent, "#6");
        }
Esempio n. 5
0
		public void AttachablePropertySetValueSuccess ()
		{
			var xt = new XamlType (typeof (Attachable), sctx);
			var apl = xt.GetAllAttachableMembers ();
			var foo = apl.First (ap => ap.Name == "Foo");
			Assert.IsTrue (foo.IsAttachable, "#7");
			var obj = new object ();
			foo.Invoker.SetValue (obj, "xxx"); // obj is non-null, so valid.
			// FIXME: this line should be unnecessary.
			AttachablePropertyServices.RemoveProperty (obj, new AttachableMemberIdentifier (foo.Type.UnderlyingType, foo.Name));
		}
Esempio n. 6
0
		public void AttachablePropertySetValueNullObject ()
		{
			var xt = new XamlType (typeof (Attachable), sctx);
			var apl = xt.GetAllAttachableMembers ();
			var foo = apl.First (ap => ap.Name == "Foo");
			Assert.IsTrue (foo.IsAttachable, "#7");
			foo.Invoker.SetValue (null, "xxx");
		}
Esempio n. 7
0
		public void AttachableProperty ()
		{
			var xt = new XamlType (typeof (Attachable), sctx);
			var apl = xt.GetAllAttachableMembers ();
			Assert.IsTrue (apl.Any (ap => ap.Name == "Foo"), "#1");
			Assert.IsTrue (apl.Any (ap => ap.Name == "Protected"), "#2");
			// oh? SetBaz() has non-void return value, but it seems ignored.
			Assert.IsTrue (apl.Any (ap => ap.Name == "Baz"), "#3");
			Assert.AreEqual (4, apl.Count, "#4");
			Assert.IsTrue (apl.All (ap => ap.IsAttachable), "#5");
			var x = apl.First (ap => ap.Name == "X");
			Assert.IsTrue (x.IsEvent, "#6");
		}
Esempio n. 8
0
		public void GetAllAttachableMembers ()
		{
			var xt = new XamlType (typeof (AttachableClass), sctx);
			var l = xt.GetAllAttachableMembers ();
			Assert.AreEqual (0, l.Count, "#1");
		}