Testing BO using MbUnit/NUnit


Author
Message
Chan
Chan
Advanced StrataFrame User (713 reputation)Advanced StrataFrame User (713 reputation)Advanced StrataFrame User (713 reputation)Advanced StrataFrame User (713 reputation)Advanced StrataFrame User (713 reputation)Advanced StrataFrame User (713 reputation)Advanced StrataFrame User (713 reputation)Advanced StrataFrame User (713 reputation)Advanced StrataFrame User (713 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I am trying to writing test case to test my BO logic using MbUnit/NUnit.



Currently, I hit DataLayerException as below. May I know how to run test on my BO successully? Do you have any test project template?



Thank you



Message: An error occurred while creating a new DataLayer for the business object.



Type: MicroFour.StrataFrame.Data.DataLayerException

Source: MicroFour StrataFrame Business

TargetSite: MicroFour.StrataFrame.Data.DataLayer get__DataLayer()

HelpLink: null

Stack: at MicroFour.StrataFrame.Business.BusinessLayer.get__DataLayer()

at MicroFour.StrataFrame.Business.BusinessLayer.GetDataTable(DbCommand CommandToExecute)

at JK.Inventory.Product.BusinessObject.ItemPricesBO.GetDataTableByItemID(Guid ItemID, DateTime AsAtDate) in F:\Projects\Inventory\InventoryBusinessObject\Product\ItemPricesBO.cs:line 85

at JK.Inventory.Product.BusinessObject.ItemPricesBO.GetPrice(Guid ItemID, DateTime AsAtDate) in F:\Projects\Inventory\InventoryBusinessObject\Product\ItemPricesBO.cs:line 63

at JK.Inventory.Product.BusinessObject.ItemPricesBO.GetPrice(Guid ItemID) in F:\Projects\Inventory\InventoryBusinessObject\Product\ItemPricesBO.cs:line 56

at TestItemPricesBO.TestItemPricesBO.TestGetPriceByItemID() in F:\Projects\Inventory\Test\TestItemPricesBO\TestItemPricesBO\TestItemPricesBO\TestItemPricesBO.cs:line 26

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.  The message you posted doesn't really give to inner exception as to what is going on.  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.  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.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search