2
如果我有一個靜態類:xunit測試是否完全隔離運行?
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 ?
}
}
由兩個測試共享的外部靜態類,或者是有測試之間完全隔離?