如果我有一个静态类:
public static class Foo
{
public static string Bar = "baz";
}
在 xunit 测试中,我做了这样的事情(人为):
public class FooTests
{
[Fact]
public void Bar_can_be_set_to_buz()
{
Foo.Bar = "buz";
}
[Fact]
public void Some_other_test()
{
//Is Foo.Bar "buz", or is there isolation ?
}
}
两个测试共享外部静态类,还是测试之间完全隔离?