Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TDD the Bizobj
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Divers
Thread ID:
00848909
Message ID:
00850032
Vues:
29
Michael,

The error appears to be occurring with the connection string and trying to extract it from the configuration file. The name of the variable stored in the .config file is case sensitive to make sure it is correctly written the way MMF needs it. I would look at the sample application to see the syntax.

>Jeffrey:
>Thanks for the suggestion. I've since resolved this error, and have gotten back to the original problem which was giving me grief.
>This is my testsuite as it currently stands:
>
>	[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.
>Now, I'm using a connection string which I've cut and pasted from another project that works correctly. But I still suspect that my problem lies in this area.
>If anyone has any suggestions I'd appreciate input at this point as I'm working near the limit of my current understanding.
>
>Mike
>
>
>
>
>>Are you using the latest NUnit, with its "Project" capabilities? If so, you probably just want to add the main MM DLL to the project -- (Mere Mortals Framework.dll). It sounds like the app you've built for your test suite can't resolve all the way up the inheritance hierarchy.
>>
>>J
>>
>>>For those familiar with NUnit the test runs fine when I run it in Addin mode. But, when I use the Gui I'm getting the following error:
>>>
>>>Acme.OrderSystem.Business.TestOrders.TestAppRunning : System.IO.FileNotFoundException : File or assembly name mmApplication, or one of its dependencies, was not found.
>>>
>>>I can't see what this is referring to, has anyone come across this?
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform