Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Marianne Hildesheim Bertelsen 26 posts 169 karma points
    Oct 24, 2014 @ 14:55
    Marianne Hildesheim Bertelsen
    0

    Unit/integration test project for uCommerce

    Hi,

    Can anyone tell me, what I need to include in a Visual Studio test project in order to be able to use the uCommerce (stateless) API from my test.

    I've tried taking a look at the "Use API in apps" http://docs.ucommerce.net/ucommerce/v6/system-integration/enable-api-outside-web-context.html page, but I just can't seem to get it working.

    Specifically I'm getting the error message when I try to utilize the uCommerce API from my test: System.Configuration.ConfigurationErrorsException : Could not autodiscover 'components.config'. Make sure it's present in the application folder.

    I'm using uCommerce 6.0.3.14141 in Umbraco 7.1.6. 

  • Morten Skjoldager 440 posts 1499 karma points
    Oct 27, 2014 @ 09:32
    Morten Skjoldager
    0

    Hi,

    You've skipped a very essential part of the docs. 

    You need to take the pipelines folder and the configuration folder from a running installation. find the two folders under /umbraco/ucommerce. 

    The error you're getting: "Could not autodiscover 'components.config'. Make sure it's present in the application folder. " Indicates that you haven't got the configuration files in order. 

    Please do that and see if you get any new errors :)

    Hope this helps, otherwise let me know! 

    Best regards

    Morten

  • Marianne Hildesheim Bertelsen 26 posts 169 karma points
    Oct 27, 2014 @ 09:53
    Marianne Hildesheim Bertelsen
    0

    Hi Morten

    Thanks for your feedback. I'll give it another (thorougher) go and post back to the forum either way.

    It's good to know that it's the correct way to go... :-)
     

    /Marianne

     

  • Marianne Hildesheim Bertelsen 26 posts 169 karma points
    Oct 27, 2014 @ 15:38
    Marianne Hildesheim Bertelsen
    101

    Finally got it working

    Had to do the following that wasn't covered in the article:

    1. When using ReSharper test runner (nUnit), I had to remove the checkmark ReSharper > Options >Tools > Unit testing > Shadow-copy assemblies being tested (I feel kindda lucky that I found this!). While it was checked, I got the "System.Configuration.ConfigurationErrorsException : Could not autodiscover 'components.config'" error.

    2. Since I'm using Umbraco 7, one of the dlls in the list in the article is called UCommerce.Umbraco7.dll rather than UCommerce.Umbraco.dll (that was easy mystery to solve).

    3. I had to include the UCommerce.RazorStore.dll as well.

    4. I had to include the Infralution.Licensing.dll file.

    5. The connection string is different than in the article. Just copy the one from your web.config.

    Hope this helps someone :-)

    uCommerce guys: Should these extra dll files be unnecessary for the test project to work?


     

Please Sign in or register to post replies

Write your reply to:

Draft