public void KnowProfileShouldBeInstantiableTest() { Hashtable knownLists = BarcodeProfileFactory.GetKnownClassList(); foreach (string profileName in knownLists.Keys) { IBarcodeProfile opt = BarcodeProfileFactory.CreateBarcodeProfileObject(profileName); opt.Setup(); Assert.IsNotNull(opt, "Object must not be null!!! [{0}]", profileName); } }
public void UnknownApplicationNameTest(string profName) { try { IBarcodeProfile opt = BarcodeProfileFactory.CreateBarcodeProfileObject(profName); Assert.True(false, "Exception shoud be throw for unknow application name!!!"); } catch (Exception e) { Assert.True(true, e.Message); } }
public static IBarcodeProfile CreateBarcodeProfileObject(string name) { string className = (string)classMaps[name]; if (className == null) { throw new ArgumentNullException(String.Format("Profile not found [{0}]", name)); } Assembly asm = Assembly.GetExecutingAssembly(); IBarcodeProfile obj = (IBarcodeProfile)asm.CreateInstance(className); obj.Setup(); return(obj); }
public void KnownApplicationNameTest(string profName) { IBarcodeProfile opt = BarcodeProfileFactory.CreateBarcodeProfileObject(profName); Assert.IsNotNull(opt, "Object must not be null!!!"); }