Unit testing application code that uses the v6 API
Hi Guys,
Has anyone tried to decouple the new Umbraco v6 services in order to unit test retrieving or updating content in their own application code?
I can see that the new services (ContentService et al.) are nicely decoupled taking the database provider & publishing strategy as constructor arguments but the ServiceContext & ApplicationContext still seem pretty closed.
Well only when using an advanced mocking framework like JustMock. I started a feature request to be able to populate an own UmbracoContext based on a faked HttpContext but no response yet. Perhaps you may want to extend my feature request for your purposes:
Unit testing application code that uses the v6 API
Hi Guys,
Has anyone tried to decouple the new Umbraco v6 services in order to unit test retrieving or updating content in their own application code?
I can see that the new services (ContentService et al.) are nicely decoupled taking the database provider & publishing strategy as constructor arguments but the ServiceContext & ApplicationContext still seem pretty closed.
Anyone had any success?
Ant
Well only when using an advanced mocking framework like JustMock. I started a feature request to be able to populate an own UmbracoContext based on a faked HttpContext but no response yet. Perhaps you may want to extend my feature request for your purposes:
http://issues.umbraco.org/issue/U4-1717
is working on a reply...