I would like to Mock the System.IO.FileInfo.Extension Method and have it return ".xls" but I can't get anything to work
This Example works great for Delete but not for Extension (The code will not compile)
[ClassInitialize]
public static void Initialize(TestContext context)
{
Mock.Partial<FileInfo>().For((x) => x.Extension);
}
I Have also tried using this example but the code is wrong.
- I have a fully licensed copy of JustMock
- I am using VS 2010 .net 4.0
Edit: I know I can setup a interface and test that way, but the paid version JustMock is supposed to mock concrete classes. Since I paid for it, I would like to know how to do it that way.