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));
		}
Beispiel #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");
		}
Beispiel #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");
        }
Beispiel #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));
        }
        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");
        }
        public void ProvideValueStaticProperty()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(XamlLanguage);
            x.Member     = "Array";
            Assert.AreEqual(XamlLanguage.Array, 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");
        }
        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");
        }
        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));
		}
Beispiel #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");
     });
 }
        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);
        }
Beispiel #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");
     });
 }
Beispiel #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!");
            }
        }
		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");
		}
Beispiel #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");
		}
		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));
		}
		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");
		}