[TestFixture] public class TestOrders { public Orders orders; public mmApplication.AppBase app; [TestFixtureSetUp] public void TestSetup() { app = new mmApplication.AppBase(); orders = new Orders(); } [Test] public void TestAppRunning() { Assert.IsTrue( mmApplication.AppBase.IsRunning ); } [Test] public void TestTableName() { Assert.AreEqual( "Orders", orders.TableName ); } [Test] public void TestDataSet() { DataSet ds = orders.GetAllOrders(); Assert.AreEqual("none", ds.GetType().ToString()); } [Test] public void TestsetGetAllOrders() { DataSet ds = orders.GetAllOrders(); Assert.AreEqual(ds.Tables["Orders"].Rows.Count, 0 ); } }The last 2 tests fail as I would expect them to, but with an error that I can't interpret:
TestCase 'Acme.OrderSystem.Business.TestOrders.TestDataSet' failed: System.NullReferenceException : Object reference not set to an instance of an object. at OakLeaf.MM.Main.Managers.mmAppSettingsManager.GetSectionSetting(String section, String key, String defaultValue) at OakLeaf.MM.Main.Managers.mmAppSettingsManager.GetSectionSetting(String section, String key) at OakLeaf.MM.Main.Managers.mmDatabaseManager.GetDataAccessClassName(String databaseKey) at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject(String databaseKey) at OakLeaf.MM.Main.Business.mmBusinessObject.FillDataSet(DataSet ds, String command, String tableName, String databaseKey, CommandType cmdType, IDbDataParameter[] dataParams) at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName, String databaseKey, CommandType cmdType, IDbDataParameter[] dataParams) at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName, String databaseKey, IDbDataParameter[] dataParams) at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName, String databaseKey) at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName) at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command) c:\temp\learningcsharp\order system business objects\orders.cs(38,0): at Acme.OrderSystem.Business.Orders.GetAllOrders() c:\temp\learningcsharp\order system business objects\orders.cs(87,0): at Acme.OrderSystem.Business.TestOrders.TestDataSet()So I've successfully added my app, instantiated it in the TestFixtureSetUp, and tested that it exists.