如何使用 MBUnit 和 C# 创建全局 testfixturesetup 例程?

发布于 2024-08-13 04:55:15 字数 210 浏览 7 评论 0原文

我在我的测试项目中使用 MBUnit,并且有一个设置例程,必须在几个不同的测试装置正常运行之前运行该例程。

目前,在每个 TestFixture 中,我在执行此操作的例程上都有 [TestFixtureSetup] 属性,但逻辑在每个单独的测试装置中不必要地重复。

使用什么方法来创建将在运行任何 TestFixture 之前运行的 TestFixtureSetup 例程?

I'm using MBUnit for my test project and have a setup routine that must run before several different test fixtures can run properly.

Currently in each TestFixture I've got the [TestFixtureSetup] attribute on a routine that performs this, but the logic is unnecessarily duplicated in each individual test fixture.

What method is used to create a TestFixtureSetup routine that will run before any TestFixture is ran?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灯角 2024-08-20 04:55:15

在 MbUnit v3 中,使用 [AssemblyFixture]。

在 MbUnit v2 中,使用 [AssemblyCleanUp]。

In MbUnit v3, use [AssemblyFixture].

In MbUnit v2, use [AssemblyCleanUp].

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文