Thanks again for reporting the issue. However, in order to mock MSCorlib types other than File, FileInfo, DateTime and HttpContext members you need to initialize it first.
As an example for FileSystemInfo,
you can initialize it inside a static constructor or during ClassInitailization of MSTest:
Mock.Partial<FileSystemInfo>().For<FileSystemInfo, DateTime>(x => x.LastWriteTimeUtc);
After this you can mock it as usual like below (provided that you have used the MockClassAttribute on top of the test class):
var mockFile = Mock.Create<FileSystemInfo>();
Mock.Arrange(() => mockFile.FullName).Returns(
Mock.Arrange(() => mockFile.Name).Returns(
Mock.Arrange(() => mockFile.LastWriteTimeUtc).Returns(DateTime.UtcNow);
var expected = mockFile.LastWriteTimeUtc;
However, there is a bug with MockClassAttribute
which is if you just move the mocked MSCorlb member to a nested class like the one you have shown:
var result = FileRoutines.IsTodaysFile(mockFile);
The test will fail but will pass if you apply MockClassAtrribute on FileRoutines class as well. We are already working on it and will release a fix for it as early as possible.
Sorry for the inconvenience.
Finally , if you want to get more information on mocking MSCorlib members i would recommend you to check the following online reference:
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>