﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » Testing BO using MbUnit/NUnit</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 10:39:49 GMT</lastBuildDate><ttl>20</ttl><item><title>Testing BO using MbUnit/NUnit</title><link>http://forum.strataframe.net/FindPost9632.aspx</link><description>Hi,&lt;br&gt;
I am trying to writing test case to test my BO logic using MbUnit/NUnit.&lt;br&gt;
&lt;br&gt;
Currently, I hit DataLayerException as below. May I know how to run test on my BO successully? Do you have any test project template?&lt;br&gt;
&lt;br&gt;
Thank you&lt;br&gt;
&lt;br&gt;
Message: An error occurred while creating a new DataLayer for the business object.&lt;br&gt;
[codesnippet]&lt;br&gt;
Type: MicroFour.StrataFrame.Data.DataLayerException&lt;br&gt;
Source: MicroFour StrataFrame Business&lt;br&gt;
TargetSite: MicroFour.StrataFrame.Data.DataLayer get__DataLayer()&lt;br&gt;
HelpLink: null&lt;br&gt;
Stack:   at MicroFour.StrataFrame.Business.BusinessLayer.get__DataLayer()&lt;br&gt;
   at MicroFour.StrataFrame.Business.BusinessLayer.GetDataTable(DbCommand CommandToExecute)&lt;br&gt;
   at JK.Inventory.Product.BusinessObject.ItemPricesBO.GetDataTableByItemID(Guid ItemID, DateTime AsAtDate) in F:\Projects\Inventory\InventoryBusinessObject\Product\ItemPricesBO.cs:line 85&lt;br&gt;
   at JK.Inventory.Product.BusinessObject.ItemPricesBO.GetPrice(Guid ItemID, DateTime AsAtDate) in F:\Projects\Inventory\InventoryBusinessObject\Product\ItemPricesBO.cs:line 63&lt;br&gt;
   at JK.Inventory.Product.BusinessObject.ItemPricesBO.GetPrice(Guid ItemID) in F:\Projects\Inventory\InventoryBusinessObject\Product\ItemPricesBO.cs:line 56&lt;br&gt;
   at TestItemPricesBO.TestItemPricesBO.TestGetPriceByItemID() in F:\Projects\Inventory\Test\TestItemPricesBO\TestItemPricesBO\TestItemPricesBO\TestItemPricesBO.cs:line 26[/codesnippet]</description><pubDate>Mon, 18 Jun 2007 08:39:16 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: Testing BO using MbUnit/NUnit</title><link>http://forum.strataframe.net/FindPost9640.aspx</link><description>There is not a test template as this would really change from each test platform and since each test environment is so different this would not be very conducive to a template.&amp;nbsp; The message you posted doesn't really give to inner exception as to what is going on.&amp;nbsp; You can turn on debug mode during testing just like you can when running through a runtime test to have an HTML log produced with all of the query information.&amp;nbsp; Using the posted stack trace, though, I cannot tell you exactly what you are running into....by first guess would be that you do not have a connection specified for the BO so the DAL cannot be created.</description><pubDate>Mon, 18 Jun 2007 08:39:16 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>