Hi Dmitry,
The problem seems to be with the CMS.Tests.UnitTests class initialization methods (OneTimeSetup). nUnit tests by default are not run in parallel, while xUnit tets are. I encounter the error with just these 2 sample tests.
[TestFixture]
[Parallelizable(ParallelScope.All)]
public class Tests : UnitTests
{
[SetUp]
public void Setup()
{
Fake<UserInfo, UserInfoProvider>().WithData(
new UserInfo[] {
new UserInfo
{
UserID = 123,
UserName = "FakeUser",
UserNickName = "FakeUser"
},
new UserInfo
{
UserID = 124,
UserName = "FakeUser4",
UserNickName = "FakeUser4"
}
});
}
[Test]
public void Test1()
{
var users = UserInfo.Provider.Get().First();
Assert.NotNull(users);
}
}
[TestFixture]
[Parallelizable(ParallelScope.All)]
internal class PageExtensionsTests : UnitTests
{
[SetUp]
public void Setup()
{
Fake<TreeNode>();
}
[Test]
public void ToDaysOfWeekTest()
{
var friday = TreeNode.New();
friday.NodeAlias = "Friday";
var sunday = TreeNode.New();
sunday.NodeAlias = "Sunday";
var treeNodes = new List<TreeNode>() { friday, sunday };
var daysOfWeek = treeNodes.ToDaysOfWeek();
Assert.NotNull(daysOfWeek);
Assert.True(daysOfWeek.Contains(DayOfWeek.Friday));
Assert.True(daysOfWeek.Contains(DayOfWeek.Sunday));
Assert.False(daysOfWeek.Contains(DayOfWeek.Monday));
}
}