I was testing something else for circular reference resistance when I noticed:
public class Foo
{
private Bar myBar = new Bar();
}
public class Bar
{
private Foo myFoo = new Foo();
}
[Fact]
public void CircularReferenceTest()
{
var foo = new Foo();
var bar = new Bar();
}
resulted in XUnit runner halt and console log:
The active test run was aborted. Reason: Process is terminated due to StackOverflowException.
I tested it on MStest and had same result. Is there a way around this? Is it a bug, or it's intended to stop execution in that way?