Mock static property with moq
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 this.applicationPath = (HttpRuntime.AppDomainAppVirtualPath.Length > 1) ? HttpRuntime.AppDomainAppVirtualPath : String.Empty; I do not know how create mocks for static class and property like HttpRuntime.AppDomainAppVirtualPath . The context , request and response have been mocked well with sample code I get from moq. I will appreciate if somebody can help me on this. Moq can't fake static members. As a solution you can create a wrapper class