The below test will pass if run under the .net 2.0 framework runtime (using nUnit which is built for .net 3.5). If you run under .net 4.0 it will fail.
Initial investigation suggests that compiled expressions still keep the filename in their stackframes.
I am putting this here to highlight the fact this test has been removed for the moment. It seems to be a bit of an edge case, doing a Shouldly assertion in an expression which you then compile and run.
//TODO Fix test in .net 4.0, expressions in .net 4.0 has the filename available in the stackframe, which causes this test to fail
[Test, Ignore]
public void CompiledLambda()
{
Expression<Action> lambda = () => 1.ShouldBe(2);
Should.Error(lambda.Compile(),
"The provided expression should be 2 but was 1");
}
// @xerxesb
The below test will pass if run under the .net 2.0 framework runtime (using nUnit which is built for .net 3.5). If you run under .net 4.0 it will fail.
Initial investigation suggests that compiled expressions still keep the filename in their stackframes.
I am putting this here to highlight the fact this test has been removed for the moment. It seems to be a bit of an edge case, doing a Shouldly assertion in an expression which you then compile and run.
// @xerxesb