【问题标题】:Is there a possibility to run a particular method only once before the whole set of tests in the .cs file run in Nunit在 .cs 文件中的整个测试集在 Nunit 中运行之前,是否有可能只运行一次特定方法
【发布时间】:2020-03-21 05:46:57
【问题描述】:

我正在使用 Xamarin UI 测试和 N 单元框架为移动应用程序编写 UI 测试。我只想在一组测试开始运行之前运行一次特定的方法(应用程序初始化)。我使用了 [one time setup] 注释,但它也在每次测试之前运行。请帮助我。

【问题讨论】:

标签: nunit


【解决方案1】:

您可以通过在任何命名空间之外创建[SetupFixture] 来做到这一点。

在此处查看文档:https://github.com/nunit/docs/wiki/SetUpFixture-Attribute

【讨论】:

    猜你喜欢
    • 2015-09-09
    • 2012-01-04
    • 2011-09-20
    • 2020-05-30
    • 1970-01-01
    • 1970-01-01
    • 2012-09-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多