I am getting an exception -
System.NullReferenceException: Object reference not set to an instance of an object.
Result StackTrace:
at System.Web.WebPages.FileExistenceCache.<.ctor>b__4(String path)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at System.Web.WebPages.FileExistenceCache.FileExists(String virtualPath)
at System.Web.Mvc.BuildManagerViewEngine.FileExists(ControllerContext controllerContext, String virtualPath)
This exception is received when i try to test my custom view engine using mocked context. I was earlier getting another error, and came to this error after properly mocking the server.MapPath. The issue is in the mocked httpcontext, and want to know what may be the reason for having this exception only on unit test with mocked httpcontext. I dont have any issues in actual running code of the custom view engine which I am trying to test.