Tag: data driven tests

使用nunit控制台传递测试用例参数

我正在使用Nunit和数据驱动的测试方法开发测试。 我有2个参数的测试方法:xlsx文件的路径和工作表名称。 当我在TestCase属性中传递参数时,它在Visual Studio中工作得很好,例如,当我想运行3个测试用例时,必须编写如下内容: [TestCase(@”pathToFile.xlsx”, “TestCase1″)] [TestCase(@”pathToFile.xlsx”, “TestCase2″)] [TestCase(@”pathToFile.xlsx”, “TestCase3”)] public void performActionsByWorksheet(string excelFilePath, string worksheetName) { //test code } 我想运行我的测试用例并使用Nunit Console传递参数(不要在代码中编写参数)。 有可能实现吗?