4
我試圖讓並行測試在NUnit v3中工作,但是,測試看起來並沒有。NUnit v3 alpha:試圖讓並行測試工作
考慮下面的測試類:
namespace NUnitAlpha3Experimental
{
[TestFixture]
[Parallelizable(ParallelScope.Children)]
class DummyTests
{
[Test]
public void MustSuccess()
{
Assert.IsTrue(true);
FileIO.appendToFile("output.txt", Reflexion.GetCurrentMethodName());
}
[Test]
public void MustFail()
{
Thread.Sleep(500);
FileIO.appendToFile("output.txt", Reflexion.GetCurrentMethodName());
Assert.IsFalse(true);
}
}
}
每當我跑我的測試中, 「MustFail」 「MustSuccess」 之前,總是輸出。如果測試並行運行,則應首先輸出「MustSuccess」。也許我的屬性有問題。我不知道。
請幫忙。謝謝。
編輯:我添加了/工= 8〜我的命令行: [...] \ NUnit3 \ NUnit控制檯NUnitAlpha3Experimental.exe /framework:net-4.5 -workers = 8 但儘管如此,我的測試中不似乎並行運行。
此處瞭解詳情:https://groups.google.com/forum/#!topic/nunit-discuss/_Zcd3EjiJGo