public void ValidatePropertyValue_Description_WrongType()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         OurToolboxItem item = new OurToolboxItem();
         item._ValidatePropertyValue("Description", false);
     });
 }
Ejemplo n.º 2
0
		public void ValidatePropertyValue_Description_WrongType ()
		{
			OurToolboxItem item = new OurToolboxItem ();
			item._ValidatePropertyValue ("Description", false);
		}
Ejemplo n.º 3
0
		public void ValidatePropertyValue_Company_WrongType ()
		{
			OurToolboxItem item = new OurToolboxItem ();
			item._ValidatePropertyValue ("Company", false);
		}
Ejemplo n.º 4
0
		public void ValidatePropertyValue_TypeName_WrongType ()
		{
			OurToolboxItem item = new OurToolboxItem ();
			item._ValidatePropertyValue ("TypeName", false);
		}
Ejemplo n.º 5
0
		public void ValidatePropertyValue_Filter_WrongType ()
		{
			OurToolboxItem item = new OurToolboxItem ();
			item._ValidatePropertyValue ("Filter", false);
		}
Ejemplo n.º 6
0
		public void ValidatePropertyValue_Bitmap_WrongType ()
		{
			OurToolboxItem item = new OurToolboxItem ();
			item._ValidatePropertyValue ("Bitmap", false);
		}
Ejemplo n.º 7
0
		public void ValidatePropertyValue ()
		{
			OurToolboxItem item = new OurToolboxItem ();
			object o = new object ();
			Assert.IsNull (item._ValidatePropertyValue (null, null), "null,null");
			Assert.AreSame (o, item._ValidatePropertyValue (null, o), "null,object");
			Assert.IsNull (item._ValidatePropertyValue ("string", null), "string,null");
			Assert.AreSame (o, item._ValidatePropertyValue ("string", o), "string,object");

			Assert.IsNull (item._ValidatePropertyValue ("AssemblyName", null), "AssemblyName,null");
			Assert.AreSame (an, item._ValidatePropertyValue ("AssemblyName", an), "AssemblyName,an");

			Assert.IsNull (item._ValidatePropertyValue ("Bitmap", null), "Bitmap,null");
			Assert.AreSame (bitmap, item._ValidatePropertyValue ("Bitmap", bitmap), "Bitmap,bitmap");

			Assert.AreEqual (String.Empty, item._ValidatePropertyValue ("DisplayName", null), "DisplayName,null");
			Assert.AreSame (String.Empty, item._ValidatePropertyValue ("DisplayName", String.Empty), "DisplayName,string");

			Assert.AreEqual (filter, item._ValidatePropertyValue ("Filter", null), "Filter,null");
			Assert.AreEqual (filter, item._ValidatePropertyValue ("Filter", filter), "Filter,ToolboxItemFilterAttribute[]");
			//Assert.IsFalse (Object.ReferenceEquals (filter, item._ValidatePropertyValue ("Filter", filter)), "Filter,ToolboxItemFilterAttribute[]/Reference");

			Assert.AreEqual (String.Empty, item._ValidatePropertyValue ("TypeName", null), "TypeName,null");
			Assert.AreSame (String.Empty, item._ValidatePropertyValue ("TypeName", String.Empty), "TypeName,string");

			Assert.AreEqual (String.Empty, item._ValidatePropertyValue ("Company", null), "Company,null");
			Assert.AreSame (String.Empty, item._ValidatePropertyValue ("Company", String.Empty), "Company,string");

			Assert.AreEqual (null, item._ValidatePropertyValue ("DependentAssemblies", null), "DependentAssemblies,null");
			Assert.AreEqual (dependent, item._ValidatePropertyValue ("DependentAssemblies", dependent), "DependentAssemblies,AssemblyName[]");
			Assert.IsTrue (Object.ReferenceEquals (dependent, item._ValidatePropertyValue ("DependentAssemblies", dependent)), "DependentAssemblies,AssemblyName[]/Reference");

			Assert.AreEqual (String.Empty, item._ValidatePropertyValue ("Description", null), "Description,null");
			Assert.AreSame (String.Empty, item._ValidatePropertyValue ("Description", String.Empty), "Description,string");

			Assert.IsTrue ((bool)item._ValidatePropertyValue ("IsTransient", true), "IsTransient,true");
			Assert.IsFalse ((bool)item._ValidatePropertyValue ("IsTransient", false), "IsTransient,false");
		}
        public void ValidatePropertyValue()
        {
            OurToolboxItem item = new OurToolboxItem();
            object         o    = new object();

            Assert.IsNull(item._ValidatePropertyValue(null, null), "null,null");
            Assert.AreSame(o, item._ValidatePropertyValue(null, o), "null,object");
            Assert.IsNull(item._ValidatePropertyValue("string", null), "string,null");
            Assert.AreSame(o, item._ValidatePropertyValue("string", o), "string,object");

            Assert.IsNull(item._ValidatePropertyValue("AssemblyName", null), "AssemblyName,null");
            Assert.AreSame(an, item._ValidatePropertyValue("AssemblyName", an), "AssemblyName,an");

            Assert.IsNull(item._ValidatePropertyValue("Bitmap", null), "Bitmap,null");
            Assert.AreSame(bitmap, item._ValidatePropertyValue("Bitmap", bitmap), "Bitmap,bitmap");

            Assert.AreEqual(String.Empty, item._ValidatePropertyValue("DisplayName", null), "DisplayName,null");
            Assert.AreSame(String.Empty, item._ValidatePropertyValue("DisplayName", String.Empty), "DisplayName,string");

            Assert.AreEqual(filter, item._ValidatePropertyValue("Filter", null), "Filter,null");
            Assert.AreEqual(filter, item._ValidatePropertyValue("Filter", filter), "Filter,ToolboxItemFilterAttribute[]");
            //Assert.IsFalse (Object.ReferenceEquals (filter, item._ValidatePropertyValue ("Filter", filter)), "Filter,ToolboxItemFilterAttribute[]/Reference");

            Assert.AreEqual(String.Empty, item._ValidatePropertyValue("TypeName", null), "TypeName,null");
            Assert.AreSame(String.Empty, item._ValidatePropertyValue("TypeName", String.Empty), "TypeName,string");

            Assert.AreEqual(String.Empty, item._ValidatePropertyValue("Company", null), "Company,null");
            Assert.AreSame(String.Empty, item._ValidatePropertyValue("Company", String.Empty), "Company,string");

            Assert.AreEqual(null, item._ValidatePropertyValue("DependentAssemblies", null), "DependentAssemblies,null");
            Assert.AreEqual(dependent, item._ValidatePropertyValue("DependentAssemblies", dependent), "DependentAssemblies,AssemblyName[]");
            Assert.IsTrue(Object.ReferenceEquals(dependent, item._ValidatePropertyValue("DependentAssemblies", dependent)), "DependentAssemblies,AssemblyName[]/Reference");

            Assert.AreEqual(String.Empty, item._ValidatePropertyValue("Description", null), "Description,null");
            Assert.AreSame(String.Empty, item._ValidatePropertyValue("Description", String.Empty), "Description,string");

            Assert.IsTrue((bool)item._ValidatePropertyValue("IsTransient", true), "IsTransient,true");
            Assert.IsFalse((bool)item._ValidatePropertyValue("IsTransient", false), "IsTransient,false");
        }
Ejemplo n.º 9
0
        public void ValidatePropertyValue_Description_WrongType()
        {
            OurToolboxItem item = new OurToolboxItem();

            item._ValidatePropertyValue("Description", false);
        }
Ejemplo n.º 10
0
        public void ValidatePropertyValue_Company_WrongType()
        {
            OurToolboxItem item = new OurToolboxItem();

            item._ValidatePropertyValue("Company", false);
        }
Ejemplo n.º 11
0
        public void ValidatePropertyValue_TypeName_WrongType()
        {
            OurToolboxItem item = new OurToolboxItem();

            item._ValidatePropertyValue("TypeName", false);
        }
Ejemplo n.º 12
0
        public void ValidatePropertyValue_Filter_WrongType()
        {
            OurToolboxItem item = new OurToolboxItem();

            item._ValidatePropertyValue("Filter", false);
        }
Ejemplo n.º 13
0
        public void ValidatePropertyValue_Bitmap_WrongType()
        {
            OurToolboxItem item = new OurToolboxItem();

            item._ValidatePropertyValue("Bitmap", false);
        }