the reason I want to fake this readonly member and File class is because they are "external" resources. I don't need to test them.
1. The production method I want to test, calls:
if File.Exists(Constants.Path) {...here is the code I want to test...}
// "Constants" is a static class, "Path" is a static readonly member in this class
I don't mind what is the path or if the file really exists, so I wanted to fake it and return "true" always in this test.
2. The public static readonly member (right, similar to constant) is the path and I really don't care what is the path for the test. The problem is that in the production code, this member is initialized with a call to another member which calls a method in another assembly:
//static "Constants" class
public static readonly string ExternalPath = System.IO.Path.Combine(AnotherAsm.Utility.ExtPath, "xxx");
public static readonly string Path = System.IO.Path.Combine(ExternalPath, "blabla.xml");
//Code under test calls the "Path" member
//non-static "Utility" class in AnotherAsm assembly
public static string ExtPath {get {(...real implementation here...)}};
My intention was a high level of test, this is why I wanted to eliminate dependencies of "external" resources.
I hope now it's clearer...