我的xamarin.ios应用程序上有一个单元测试项目。有没有办法强制单元测试按顺序运行而不是并行运行。
请,我不需要任何建议,例如"您应该以独立的方式编写单元测试。"或类似的东西。 我需要的是,"是否可以使用nUnitlite并行运行测试 NOT 。"
[TestFixture]
public class ExpenseTests
{
string _dbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "expensemanager.db3");
public void DbSetup()
{
if (File.Exists(_dbPath))
File.Delete(_dbPath);
var db = new SQLiteConnection(new SQLitePlatformIOS(), _dbPath);
db.CreateTable<Category>();
db.CreateTable<Expense>();
var category = new Category()
{
Name = "category",
Plan = 20
};
category.Upsert();
}
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void Create_NegativeValue()
{
DbSetup();
var expense = new Expense()
{
CategoryId = _categoryId,
Description = string.Empty,
Value = -10
};
expense.Upsert();
}
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void Create_LongDescription()
{
DbSetup();
string description = string.Empty;
for (int i = 0; i < 201; i++)
{
description += i;
}
var expense = new Expense()
{
CategoryId = _categoryId,
Description = description,
Value = 10
};
expense.Upsert();
}