示例#1
0
        public void ProvideValueWithoutMember()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(int);
            x.ProvideValue(null);
        }
		public void ProvideValueInstanceProperty ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (StaticExtension);
			x.Member = "MemberType"; // instance property is out of scope.
			Assert.Throws<ArgumentException> (() => x.ProvideValue (null));
		}
示例#3
0
        public void ProvideValueWithoutMember()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(int);
            Assert.Throws <InvalidOperationException> (() => x.ProvideValue(null));
        }
		public void ProvideValueInstanceProperty ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (StaticExtension);
			x.Member = "MemberType"; // instance property is out of scope.
			x.ProvideValue (null);
		}
		public void ProvideValueStaticProperty ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (XamlLanguage);
			x.Member = "Array";
			Assert.AreEqual (XamlLanguage.Array, x.ProvideValue (null), "#1");
		}
示例#6
0
        public void ProvideValuePrivateConst()
        {
            var x = new StaticExtension();

            x.MemberType = GetType();
            x.Member     = "FooBar";         // private const could not be resolved.
            Assert.Throws <ArgumentException> (() => x.ProvideValue(null), "#1");
        }
示例#7
0
        public void ProvideValueInstanceProperty()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(StaticExtension);
            x.Member     = "MemberType";         // instance property is out of scope.
            Assert.Throws <ArgumentException> (() => x.ProvideValue(null));
        }
示例#8
0
        public void ProvideValuePrivateConst()
        {
            var x = new StaticExtension();

            x.MemberType = GetType();
            x.Member     = "FooBar";         // private const could not be resolved.
            Assert.AreEqual("foobar", x.ProvideValue(null), "#1");
        }
示例#9
0
        public void ProvideValueStaticProperty()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(XamlLanguage);
            x.Member     = "Array";
            Assert.AreEqual(XamlLanguage.Array, x.ProvideValue(null), "#1");
        }
示例#10
0
        public void ProvideValueConst()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(XamlLanguage);
            x.Member     = "Xaml2006Namespace";
            Assert.AreEqual(XamlLanguage.Xaml2006Namespace, x.ProvideValue(null), "#1");
        }
示例#11
0
        public void ProvideValueEvent()
        {
            var x = new StaticExtension();

            x.MemberType = GetType();
            x.Member     = "FooEvent";         // private const could not be resolved.
            Assert.IsNotNull(x.ProvideValue(null), "#1");
        }
示例#12
0
        public void ProvideValueInstanceProperty()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(StaticExtension);
            x.Member     = "MemberType";         // instance property is out of scope.
            x.ProvideValue(null);
        }
		public void ProvideValueWithoutType ()
		{
			var x = new StaticExtension ();
			// it fails because it cannot be resolved to a static member.
			// This possibly mean, there might be a member that 
			// could be resolved only with the name, without type.
			x.Member = "Foo";
			Assert.Throws<ArgumentException> (() => x.ProvideValue (null));
		}
示例#14
0
 public void ProvideValueEvent()
 {
     Assert.Throws(typeof(ArgumentException), () =>
     {
         var x        = new StaticExtension();
         x.MemberType = GetType();
         x.Member     = "FooEvent";             // private const could not be resolved.
         Assert.IsNotNull(x.ProvideValue(null), "#1");
     });
 }
示例#15
0
        public void ProvideValueWithoutType()
        {
            var x = new StaticExtension();

            // it fails because it cannot be resolved to a static member.
            // This possibly mean, there might be a member that
            // could be resolved only with the name, without type.
            x.Member = "Foo";
            x.ProvideValue(null);
        }
示例#16
0
 public void ProvideValuePrivateConst()
 {
     Assert.Throws(typeof(ArgumentException), () =>
     {
         var x        = new StaticExtension();
         x.MemberType = GetType();
         x.Member     = "FooBar";             // private const could not be resolved.
         Assert.AreEqual("foobar", x.ProvideValue(null), "#1");
     });
 }
示例#17
0
        public void StaticExtensionProvideValue()
        {
            tlog.Debug(tag, $"StaticExtensionProvideValue START");

            try
            {
                IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
                s1.ProvideValue(serviceProviderimplement);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                tlog.Debug(tag, $"StaticExtensionProvideValue END (OK)");
                Assert.Pass("Caught Exception : passed!");
            }
        }
示例#18
0
		public void ProvideValueEvent ()
		{
			var x = new StaticExtension ();
			x.MemberType = GetType ();
			x.Member = "FooEvent"; // private const could not be resolved.
			Assert.IsNotNull (x.ProvideValue (null), "#1");
		}
示例#19
0
 public void StaticExtensionProvideValue()
 {
     tlog.Debug(tag, $"StaticExtensionProvideValue START");
     Assert.Throws <ArgumentNullException>(() => sExtention.ProvideValue(null));
     tlog.Debug(tag, $"StaticExtensionProvideValue END");
 }
		public void ProvideValuePrivateConst ()
		{
			var x = new StaticExtension ();
			x.MemberType = GetType ();
			x.Member = "FooBar"; // private const could not be resolved.
			Assert.Throws<ArgumentException> (() => x.ProvideValue (null), "#1");
		}
		public void ProvideValueConst ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (XamlLanguage);
			x.Member = "Xaml2006Namespace";
			Assert.AreEqual (XamlLanguage.Xaml2006Namespace, x.ProvideValue (null), "#1");
		}
示例#22
0
		public void ProvideValueWithoutMember ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (int);
			x.ProvideValue (null);
		}
		public void ProvideValueWithoutMember ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (int);
			Assert.Throws<InvalidOperationException> (() => x.ProvideValue (null));
		}
示例#24
0
		public void ProvideValuePrivateConst ()
		{
			var x = new StaticExtension ();
			x.MemberType = GetType ();
			x.Member = "FooBar"; // private const could not be resolved.
			Assert.AreEqual ("foobar", x.ProvideValue (null), "#1");
		}