Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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?
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
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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?
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
is working on a reply...