本文整理汇总了C#中ITestMethod.GetComputedProperty方法的典型用法代码示例。如果您正苦于以下问题:C# ITestMethod.GetComputedProperty方法的具体用法?C# ITestMethod.GetComputedProperty怎么用?C# ITestMethod.GetComputedProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITestMethod
的用法示例。
在下文中一共展示了ITestMethod.GetComputedProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Discover
public IEnumerable<IXunitTestCase> Discover (ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
{
var defaultMethodDisplay = discoveryOptions.MethodDisplayOrDefault ();
if (testMethod.Method.GetParameters ().Any ()) {
return new IXunitTestCase[] {
new ExecutionErrorTestCase (messageSink, defaultMethodDisplay, testMethod, "[VsixFact] methods are not allowed to have parameters.")
};
} else {
var vsVersions = VsVersions.GetFinalVersions(testMethod.GetComputedProperty<string[]>(factAttribute, SpecialNames.VsixAttribute.VisualStudioVersions));
// Process VS-specific traits.
var suffix = testMethod.GetComputedArgument<string>(factAttribute, SpecialNames.VsixAttribute.RootSuffix) ?? "Exp";
var newInstance = testMethod.GetComputedArgument<bool?>(factAttribute, SpecialNames.VsixAttribute.NewIdeInstance);
var timeout = testMethod.GetComputedArgument<int?>(factAttribute, SpecialNames.VsixAttribute.TimeoutSeconds).GetValueOrDefault(XunitExtensions.DefaultTimeout);
var testCases = new List<IXunitTestCase>();
// Add invalid VS versions.
testCases.AddRange (vsVersions
.Where (v => !VsVersions.InstalledVersions.Contains (v))
.Select (v => new ExecutionErrorTestCase (messageSink, defaultMethodDisplay, testMethod,
string.Format ("Cannot execute test for specified {0}={1} because there is no VSSDK installed for that version.", SpecialNames.VsixAttribute.VisualStudioVersions, v))));
testCases.AddRange (vsVersions
.Where (v => VsVersions.InstalledVersions.Contains (v))
.Select (v => new VsixTestCase (messageSink, defaultMethodDisplay, testMethod, v, suffix, newInstance, timeout)));
return testCases;
}
}