Umbraco.Web.UmbracoContext.EnsureContext(new HttpContextWrapper(new HttpContext(new HttpRequest("", "http://www.myserver.com", ""), new HttpResponse(null))), ApplicationContext.Current);
Which has got around the original "UmbracoContext" cannot be null, but is now throwing:
Current has not been initialized on Umbraco.Web.PublishedCache.PublishedCachesResolver. You must initialize Current before trying to read it.
The published caches resolver also seems to be hidden behind internal and protected stuff, which I cant use reflection to hack at as I cant init anything to pass into SetProperty reflection.
Its really frustrating, im loving v6, and using uMapper is very nice. I can inject a repo, service, command or querry at will into the controllers and life is good - I just cant cover the controllers! Granted the controllers pass of straight to a repo, service command or querry but I would still like coverage over my controllers.
Umbraco 6.12, unit testing controllers PublishedCachesResolver
So im working with Umbraco 6.12 and having great difficulty been able to test a RenderMvcController.
I have implemented IApplicationEventHandler in my Global.ascx and Ninject is working fine and as expected when running the application - all good.
However, Unit Testing these controllers is a different matter. I found this, and have added the latest reply:
http://issues.umbraco.org/issue/U4-1717
I now have this lovely hack in my SetUp:
Which has got around the original "UmbracoContext" cannot be null, but is now throwing:
The published caches resolver also seems to be hidden behind internal and protected stuff, which I cant use reflection to hack at as I cant init anything to pass into SetProperty reflection.
Its really frustrating, im loving v6, and using uMapper is very nice. I can inject a repo, service, command or querry at will into the controllers and life is good - I just cant cover the controllers! Granted the controllers pass of straight to a repo, service command or querry but I would still like coverage over my controllers.
Any help on this would be greatly appreciated.
Thanks.
I've run into this same issue & can only find others echoing the problem via google..
Did you ever resolve this? If so, how?
Thanks!
is working on a reply...