public void Filter() { OurToolboxItem item = new OurToolboxItem(); Assert.IsNull(item.Filter("AssemblyName", null), "AssemblyName,null"); // they are "equal" (publicly wise) but have a different hash code Assert.AreEqual(typeof(AssemblyName), item.Filter("AssemblyName", an).GetType(), "AssemblyName,an"); Assert.IsNull(item.Filter("Bitmap", null), "Bitmap,null"); Assert.AreSame(bitmap, item.Filter("Bitmap", bitmap), "Bitmap,bitmap"); Assert.AreEqual(String.Empty, item.Filter("DisplayName", null), "DisplayName,null"); Assert.AreSame(String.Empty, item.Filter("DisplayName", String.Empty), "DisplayName,string"); Assert.AreEqual(filter, item.Filter("Filter", null), "Filter,null"); Assert.AreSame(filter, item.Filter("Filter", filter), "Filter,ToolboxItemFilterAttribute[]"); Assert.AreEqual(String.Empty, item.Filter("TypeName", null), "TypeName,null"); Assert.AreSame(String.Empty, item.Filter("TypeName", String.Empty), "TypeName,string"); Assert.IsNull(item.Filter("Company", null), "Company,null"); Assert.AreSame(String.Empty, item.Filter("Company", String.Empty), "Company,string"); Assert.AreEqual(null, item.Filter("DependentAssemblies", null), "DependentAssemblies,null"); // note: not same Assert.AreEqual(dependent, item.Filter("DependentAssemblies", filter), "DependentAssemblies,AssemblyName[]"); Assert.IsFalse(Object.ReferenceEquals(dependent, item.Filter("DependentAssemblies", filter)), "DependentAssemblies,AssemblyName[]/Reference"); Assert.IsNull(item.Filter("Description", null), "Description,null"); Assert.AreSame(String.Empty, item.Filter("Description", String.Empty), "Description,string"); Assert.IsTrue((bool)item.Filter("IsTransient", true), "IsTransient,true"); Assert.IsFalse((bool)item.Filter("IsTransient", false), "IsTransient,false"); }
public void ValidatePropertyType() { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyType("IsTransient", true, typeof(bool), false); item._ValidatePropertyType("IsTransient", String.Empty, typeof(string), false); }
public void TestCheckUnlocked1() { OurToolboxItem item = new OurToolboxItem(); item.Lock(); item._CheckUnlocked(); }
public void ValidatePropertyType_DontAllowNull() { Assert.Throws <ArgumentNullException>(() => { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyType("IsTransient", null, typeof(bool), false); }); }
public void ValidatePropertyType_Type_Null() { Assert.Throws <NullReferenceException>(() => { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyType("IsTransient", true, null, false); }); }
public void ValidatePropertyType_IsTransient_WrongType() { Assert.Throws <ArgumentException>(() => { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyType("IsTransient", new object(), typeof(bool), false); }); }
public void ValidatePropertyValue_Description_WrongType() { Assert.Throws <ArgumentException>(() => { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyValue("Description", false); }); }
public void TestCheckUnlocked1() { Assert.Throws <InvalidOperationException>(() => { OurToolboxItem item = new OurToolboxItem(); item.Lock(); item._CheckUnlocked(); }); }
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 ValidatePropertyType_DontAllowNull () { OurToolboxItem item = new OurToolboxItem (); item._ValidatePropertyType ("IsTransient", null, typeof (bool), false); }
public void ValidatePropertyType_Type_Null () { OurToolboxItem item = new OurToolboxItem (); item._ValidatePropertyType ("IsTransient", true, null, false); }
public void ValidatePropertyType_IsTransient_WrongType () { OurToolboxItem item = new OurToolboxItem (); item._ValidatePropertyType ("IsTransient", new object (), typeof (bool), false); }
public void Filter () { OurToolboxItem item = new OurToolboxItem (); Assert.IsNull (item.Filter ("AssemblyName", null), "AssemblyName,null"); // they are "equal" (publicly wise) but have a different hash code Assert.AreEqual (typeof (AssemblyName), item.Filter ("AssemblyName", an).GetType (), "AssemblyName,an"); Assert.IsNull (item.Filter ("Bitmap", null), "Bitmap,null"); Assert.AreSame (bitmap, item.Filter ("Bitmap", bitmap), "Bitmap,bitmap"); Assert.AreEqual (String.Empty, item.Filter ("DisplayName", null), "DisplayName,null"); Assert.AreSame (String.Empty, item.Filter ("DisplayName", String.Empty), "DisplayName,string"); Assert.AreEqual (filter, item.Filter ("Filter", null), "Filter,null"); Assert.AreSame (filter, item.Filter ("Filter", filter), "Filter,ToolboxItemFilterAttribute[]"); Assert.AreEqual (String.Empty, item.Filter ("TypeName", null), "TypeName,null"); Assert.AreSame (String.Empty, item.Filter ("TypeName", String.Empty), "TypeName,string"); Assert.IsNull (item.Filter ("Company", null), "Company,null"); Assert.AreSame (String.Empty, item.Filter ("Company", String.Empty), "Company,string"); Assert.AreEqual (null, item.Filter ("DependentAssemblies", null), "DependentAssemblies,null"); // note: not same Assert.AreEqual (dependent, item.Filter ("DependentAssemblies", filter), "DependentAssemblies,AssemblyName[]"); Assert.IsFalse (Object.ReferenceEquals (dependent, item.Filter ("DependentAssemblies", filter)), "DependentAssemblies,AssemblyName[]/Reference"); Assert.IsNull (item.Filter ("Description", null), "Description,null"); Assert.AreSame (String.Empty, item.Filter ("Description", String.Empty), "Description,string"); Assert.IsTrue ((bool) item.Filter ("IsTransient", true), "IsTransient,true"); Assert.IsFalse ((bool) item.Filter ("IsTransient", false), "IsTransient,false"); }
public void ValidatePropertyType () { OurToolboxItem item = new OurToolboxItem (); item._ValidatePropertyType ("IsTransient", true, typeof (bool), false); item._ValidatePropertyType ("IsTransient", String.Empty, typeof (string), false); }
public void ValidatePropertyValue_Filter_WrongType () { OurToolboxItem item = new OurToolboxItem (); item._ValidatePropertyValue ("Filter", false); }
public void GetType_Null_Null_String_False() { OurToolboxItem item = new OurToolboxItem(); Assert.IsNull(item._GetType(null, null, "string", false), "GetType"); }
public void ValidatePropertyValue_Company_WrongType () { OurToolboxItem item = new OurToolboxItem (); item._ValidatePropertyValue ("Company", false); }
public void ValidatePropertyValue_Filter_WrongType() { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyValue("Filter", false); }
public void ValidatePropertyValue_TypeName_WrongType() { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyValue("TypeName", false); }
public void ValidatePropertyType_Type_Null() { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyType("IsTransient", true, null, false); }
public void ValidatePropertyValue_Company_WrongType() { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyValue("Company", false); }
public void ValidatePropertyType_IsTransient_WrongType() { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyType("IsTransient", new object(), typeof(bool), false); }
public void ValidatePropertyType_DontAllowNull() { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyType("IsTransient", null, typeof(bool), 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"); }
public void TestCheckUnlocked2 () { OurToolboxItem item = new OurToolboxItem (); item._CheckUnlocked (); }
public void ValidatePropertyValue_Bitmap_WrongType () { OurToolboxItem item = new OurToolboxItem (); item._ValidatePropertyValue ("Bitmap", false); }
public void GetType_Null_Null_String_False () { OurToolboxItem item = new OurToolboxItem (); Assert.IsNull (item._GetType (null, null, "string", false), "GetType"); }
public void ValidatePropertyValue_TypeName_WrongType () { OurToolboxItem item = new OurToolboxItem (); item._ValidatePropertyValue ("TypeName", false); }
public void ValidatePropertyValue_Description_WrongType() { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyValue("Description", false); }
public void ValidatePropertyValue_Description_WrongType () { OurToolboxItem item = new OurToolboxItem (); item._ValidatePropertyValue ("Description", false); }
public void ValidatePropertyValue_Bitmap_WrongType() { OurToolboxItem item = new OurToolboxItem(); item._ValidatePropertyValue("Bitmap", false); }