首页 > 解决方案 > XUnit 中的自定义 BeforeTestStarting

问题描述

我可以实现我的自定义版本,Xunit.Sdk.BeforeTestStarting然后以某种方式注册它吗?我想为从ClassData. 我无法通过,BeforeAfterTestAttribute因为我无权访问属性中的测试用例数据。但正如我所见,我可以BeforeTestStarting通过ITest.

标签: c#xunitxunit.net

解决方案


这个 xunit 示例https://github.com/xunit/samples.xunit/tree/master/AssemblyFixtureExample/XunitExtensions展示了这个逻辑是如何工作的


推荐阅读