2012-11-30 28 views

回答

2

不幸的是没有。我们在课堂上没有相应的TestProperty。

1

刚刚发现此初始化中使用的TestProperty类的用法以设置类成员。它设置一个默认的和您标记使用不同的设置测试与[TestProperty("thing", "non-default")]

[ClassInitialize()] 
public void InitializeClass(TestContext testContext) 
{ 
    // Changed by the [TestProperty("thing", "non-default")] 
    if (TestContext.Properties.Contains("thing")) 
     _thing = TestContext.Properties["thing"] as string; 
    else 
     _thing = "default"; 
} 

进一步的解释是here

相关问题