gpt4 book ai didi

c# - 使用带有 TestCase 属性的 nunit3-console.exe 进行参数化测试

转载 作者:行者123 更新时间:2023-11-30 20:30:18 24 4
gpt4 key购买 nike

我正在尝试使用 TestCase 属性运行 nunit3 参数化测试。

我的测试方法是这样的:

[Test]
[TestCase("testuser")]
public void OBA_Test(String name)
{
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(10000));
driver.Navigate().GoToUrl(baseURL + somewebsite)
// Code to test website.
}

然后我获取 dll 并尝试使用

运行
nunit3-console.exe "C:\temp\test\Selenium Testing Prod.dll" /run:"SeleniumTests.SeleniunProdTest.OBA_Test(\"testuser\")"

enter image description here

我在这里做错了什么?任何指针?

引用:nunit-console does not run tests parameterized with TestCase attribute

最佳答案

该消息告诉您,您正在使用的 NUnit 版本无法识别 /run 选项。 NUnit V2 的 /run 被 NUnit 3 中增强的 /test 选项取代。

关于c# - 使用带有 TestCase 属性的 nunit3-console.exe 进行参数化测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45044922/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com