具有属性属性的Nunit3 TestCaseSource

时间:2019-02-16 21:10:27

标签: c# nunit-3.0

在Nunit3中,当我分别使用TestCaseSource或Property Attribute时,它可以完美工作。但是,当我尝试一起使用它们时,没有获得Property值,并且在TestContext中没有更新这些值。

    [TestCaseSource(typeof(TestDataSourceBase), nameof(TestDataSourceBase.GetRandomNumberTests))]
    [Test, Property("Sample", "8")]
    public void TestMethod1(TestDataSourceModel testData)
    {
        var _Keys = TestContext.CurrentContext.Test.Properties.Keys;
    ....

    }

我是否可以设置除属性以外的其他数据?

在我的案例中,TestDataSource在多个测试案例中很常见。

0 个答案:

没有答案
相关问题