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.

  • slava 9 posts 29 karma points
    Jan 22, 2015 @ 17:21
    slava
    0

    unit tests with uCommerce code

    Hello, I'd like to write unit tests with uCommerce code. I found that uCommerce uses ObjectFactory.Instance to resolve a service (like SiteContext, Repository), but I am not able to replace a service in ObjectFactory.Instance. How shell I do?

  • Morten Skjoldager 440 posts 1499 karma points
    Jan 23, 2015 @ 09:25
    Morten Skjoldager
    0

    Hi slava, yes that is possible. 

    We're using castle windsor for dependency injection and the way of registering services is by ID.:

    http://docs.ucommerce.net/ucommerce/v6/extending-ucommerce/register-a-component.html

    You can download our master class repository here:

    https://bitbucket.org/uCommerce/ucommerce-master-class

    It contains a console application that has all configuration in place for unit testing (You can move it to an actual unit test project if you wish).

    Hope this is what you were looking for?

    Best regards

    Morten 

     

Please Sign in or register to post replies

Write your reply to:

Draft