Unit testing method converting MVC view to string using View.Render method
问题 I have written method that converts MVC view to string and test method to check if it returns string. Of course it works with Web but when I run test in NUnit it throws a NullReferenceException in System.Web when method tries to call View.Render. Here is StackTrace: w System.Web.VirtualPath.GetCacheKey() w System.Web.Compilation.BuildManager.GetCacheKeyFromVirtualPath(VirtualPath virtualPath, Boolean& keyFromVPP) w System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal