面对构建错误类型或名称空间名称“ OneTimeSetUpAttribute”和“ OneTimeTearDownAttribute”不存在
Xamarin.UITest版本3.0.0
Nunit-版本2.6.4
NunitTestAdapter-版本2.0.0
Specflow-版本2.1.0.0
答案 0 :(得分:1)
OneTimeSetUpAttribute
存在于NUnit 2.6.5中,可以在这里找到文档:http://nunitsoftware.com/nunitv2/index.php?p=onetimeSetUp&r=2.6.5
因此,您可以尝试做的第一件事就是更新NUnit NuGet软件包。 如果您使用的是SpecFlow,则编辑SpecFlow生成的文件将无济于事,因为它们将由SpecFlow再次重新生成。
最好的办法是开始使用新的NUnit 3.x和新的SpecFlow软件包。
答案 1 :(得分:0)
OneTimeSetUpAttribute
直到NUnit 3.0才存在。相反,您想使用TestFixtureSetUpAttribute
。
您可以在这里找到NUnit 2.6.4的文档:http://nunit.org/docs/2.6.4/docHome.html
答案 2 :(得分:0)
在NUnit 2.6.4中,SetUpFixture
使用了SetUpAttribute
和TearDownAttribute
。在NUnit 3中,这已更改为OneTimeSetUpAttribute
和OneTimeTearDownAttribute
。@ Chris所指的hange也发生了,但它影响TestFixture
而不是SetUpFixture
。