AI OnAI Off
Found this when doing some reflection
Version 7.13.0
///
/// Default constructor that fetches dependencies from IOC container.
///
public XFormPageUnknownActionHandler() : this(ServiceLocator.get_Current().GetInstance())
{
}
///
/// Constructor with dependencies
///
/// The url resolver to use.
public XFormPageUnknownActionHandler(UrlResolver urlResolver)
{
this._urlResolver = urlResolver;
}
Version 7.0.586.24
///
/// Creates a .
///
public XFormPageUnknownActionHandler()
{
}
So I need to think of some way to fake this interface in my test
Could you not take in UrlResolver as a dependency in your controller and then just pass that instance to XFormPageUnknownActionHandler using the constructor that takes it as argument. The whenever you create your controller in your test you can pass in a mock of UrlResolver.
Thanks Johan, I just tried to do that and it seems to work.
Well, what to learn from this..... Never extend if you not in great need....
We have some unittest that has start to fail after upgrading to EPiServer 7.5.
The error message we get is this:
{"StructureMap Exception Code: 202\nNo Default Instance defined for PluginFamily System.Web.Hosting.VirtualPathProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}
We get it in our extensionclass of PageController (looks like this:)
And the error comes on this line:
I guess something has changed for that setup that we has missed to implement. Anyone know what?