Temporary workaround:
1) In MvcApplication, output the RegisterAllAreas()
virtual method
public class MvcApplication : HttpApplication { public void Application_Start() {
2) In the specification, execute the proxy:
[Subject(typeof(MvcApplication))] public class when_application_starts : mvc_application_spec { protected static MvcApplication application; protected static bool areas_registered; Establish context = () => application = new MvcApplicationProxy(); Because of = () => application.Application_Start(); It should_register_mvc_areas = () => areas_registered.ShouldBeTrue(); class MvcApplicationProxy : MvcApplication { protected override void RegisterAllAreas() { areas_registered = true; } } }
3) Testing AreaRegistration
implementations individually
4) Exclude MvcApplication.RegisterAllAreas()
from the test coverage
I do not like this approach, but we cannot think of a better solution right now.
Ideas and comments are welcome & hellip;
source share