Thank you for contacting Telerik support.
In order to mock "VirtualPathUtility" class, you do not
need to use Mock.Replace, as it is generally used for mocking MSCorlib members. You can read more about it here:
To mock this class, I simply dropped the XTest() method from your example and the rest behaved as expected. I added some more content to your test method just to show that it is working for other methods from the "VirtualPathUtility" class. Here is the example:
(System.Web.VirtualPathUtility), Behavior.CallOriginal, StaticConstructor.Mocked);
Mock.Arrange(() => System.Web.VirtualPathUtility.ToAbsolute(Arg.AnyString)).Returns(expected);
Mock.Arrange(() => System.Web.VirtualPathUtility.IsAbsolute(Arg.AnyString)).Returns(
actual = System.Web.VirtualPathUtility.ToAbsolute(
actualBool = System.Web.VirtualPathUtility.IsAbsolute(
If this does not solve your issue and the exception still remain, I would recommend you to update the JustMock references in your project.
I hope this helps. If there is anything else, I can help you with, please do not hesitate to ask.
the Telerik team