I am pretty new to use moq. I am into creating some unit test case to HttpModule
and everything works fine until I hit a static
property as follows
Using Microsoft Fakes as suggested by @Sujith is a viable solution. Here is how you actually do it:
System.Web
in your reference of your test project and right clickSystem.Web.4.0.0.0.Fakes
Use following code:
using (Microsoft.QualityTools.Testing.Fakes.ShimsContext.Create()) { System.Web.Fakes.ShimHttpRuntime.AppDomainAppVirtualPathGet = () => "/"; // Do what ever needs the faked AppDomainAppVirtualPath }