logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to forums.ablecommerce.com. Please use your AbleCommerce username and password to Login. Forums Registration.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne @ AbleMods LLC  
#1 Posted : Thursday, October 24, 2019 9:00:54 AM(UTC)
Joe Payne @ AbleMods LLC

Rank: Advanced Member

Groups: Developers
Joined: 11/9/2018(UTC)
Posts: 37

Thanks: 4 times
Was thanked: 3 time(s) in 3 post(s)
I've created a unit test class to test some functionality in another class library I've built. I've added references to CommerceBuilder, Windsor and nHibernate. I can instantiate Able class objects. When I try to call a method in the other class library that instantiates a repository (OrderItemRepository), I'm getting exceptions about log4net.config not being found.

How do I set up a unit test that can involve CB classes? Is there some sort of bootstrap I need to call from the unit test?

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. Forums Registration.

Joe Payne @ AbleMods LLC  
#2 Posted : Saturday, November 2, 2019 8:59:16 AM(UTC)
Joe Payne @ AbleMods LLC

Rank: Advanced Member

Groups: Developers
Joined: 11/9/2018(UTC)
Posts: 37

Thanks: 4 times
Was thanked: 3 time(s) in 3 post(s)
I really need some help with setting up unit tests.

I even tried setting one up inside the CommerceBuilder class, I get an exception that database configuration has not been set thrown by DatabaseConfiguration class.

Suggestions?
mazhar  
#3 Posted : Thursday, November 7, 2019 4:36:28 AM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 11

Was thanked: 3 time(s) in 3 post(s)
Hi, just copy/past log4net config file from your App_Data into Bin/Debug or Bin/Release folder of your Unit test project depending upon your build configuration. Log4net will probs the Bin directory to find the configurations so that should fix it.

Edited by user Thursday, November 7, 2019 5:26:53 AM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.