public void TestDatabaseLookupListWithClassDef() { XmlDatabaseLookupListLoader loader = new XmlDatabaseLookupListLoader(new DtdLoader(), GetDefClassFactory()); MyBO.LoadDefaultClassDef(); ILookupList def = loader.LoadLookupList( @"<databaseLookupList sql=""Source"" class=""MyBO"" assembly=""Habanero.Test"" />"); IDatabaseLookupList source = (IDatabaseLookupList)def; Assert.AreEqual("MyBO", source.ClassName); Assert.AreEqual("Habanero.Test", source.AssemblyName); Assert.AreEqual(10000, source.TimeOut); }
public void TestDatabaseLookupListWithInvalidTimeout() { try { XmlDatabaseLookupListLoader loader = new XmlDatabaseLookupListLoader(new DtdLoader(), GetDefClassFactory()); loader.LoadLookupList( @"<databaseLookupList sql=""Source"" timeout=""aaa"" />"); Assert.Fail("Expected to throw an InvalidXmlDefinitionException"); } //---------------Test Result ----------------------- catch (InvalidXmlDefinitionException ex) { StringAssert.Contains("'databaseLookupList' element, an invalid integer was assigned to the 'timeout' attribute", ex.Message); } }