为什么此代码会在运算符中抛出 ShimNotSupportedException?
ShimStreamReader.AllInstances.EndOfStreamGet = ((s)=>calls < 1);
[TestMethod]
public void GetAllLinesFromFile__()
{
int calls = 0;
using (ShimsContext.Create())
{
ShimStreamReader.AllInstances.EndOfStreamGet = ((s)=>calls < 1);
ShimStreamReader.AllInstances.ReadLine = (s) =>
{
calls++;
return ";;;;;;;;;;";
};
var streamFake = new ShimStreamReader();
var obj = new MyFile(streamFake, ';');
Assert.IsTrue(obj.GetAllLinesFromFile().Count() == 1);
}
}