本文整理汇总了C#中TestCase.SetPropertyValue方法的典型用法代码示例。如果您正苦于以下问题:C# TestCase.SetPropertyValue方法的具体用法?C# TestCase.SetPropertyValue怎么用?C# TestCase.SetPropertyValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestCase
的用法示例。
在下文中一共展示了TestCase.SetPropertyValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTestCase
public TestCase GetTestCase(TestData testData)
{
string displayName;
var fullName = testData.FullName;
var pos = fullName.LastIndexOf('/');
if (pos == -1)
{
displayName = testData.CodeReference.MemberName;
}
else
{
displayName = fullName.Substring(pos + 1);
}
var testCase = new TestCase(fullName, new Uri(GallioAdapter.ExecutorUri), GetSource(testData))
{
CodeFilePath = testData.CodeLocation.Path,
LineNumber = testData.CodeLocation.Line,
DisplayName = displayName
};
testCase.SetPropertyValue(testIdProperty, testData.Id);
return testCase;
}
示例2: AddToSink
public static TestCase AddToSink(string source, DefinitionSource definitionSources, ITestCaseDiscoverySink discoverySink)
{
var it = definitionSources;
var testCase = new TestCase(it.ParentDescription + " " + it.Description + ".spec" + it.LineNumber, specTestExecutor.ExecutorUri, source);
testCase.CodeFilePath = it.CodeBase;
testCase.LineNumber = it.LineNumber;
testCase.DisplayName = it.Description;
testCase.SetPropertyValue(TestResultProperties.ErrorMessage, "No error");
testCase.Traits.Add("File", it.FileName);
testCase.Traits.Add("SpecId", it.Id);
if (discoverySink != null)
{
discoverySink.SendTestCase(testCase);
}
return testCase;
}
示例3: GetTests
public static List<TestCase> GetTests(IEnumerable<string> sources, ITestCaseDiscoverySink discoverySink)
{
var testList = new List<TestCase>();
foreach (var source in sources)
{
using (var sr = new StreamReader(source))
{
var json = sr.ReadToEnd();
var tests = JsonConvert.DeserializeObject<List<Test>>(json);
foreach (var test in tests)
{
if (string.IsNullOrEmpty(test.Name))
{
continue;
}
var testCase = new TestCase(test.Name, JsonTestExecutor.ExecutorUri, source)
{
CodeFilePath =
source,
};
if (discoverySink != null)
{
discoverySink.SendTestCase(testCase);
}
else
{
TestOutcome outcome;
Enum.TryParse<TestOutcome>(test.Outcome, out outcome);
testCase.SetPropertyValue(TestResultProperties.Outcome, outcome);
}
testList.Add(testCase);
}
}
}
return testList;
}
示例4: CreateTestCase
public static TestCase CreateTestCase(Test test, string source)
{
var testCase = new TestCase(test.FullyQualifiedName, Globals.ExecutorUri, source);
testCase.DisplayName = test.DisplayName;
testCase.SetPropertyValue(Globals.FileIndexProperty, test.Index);
if (test.Source != null)
{
testCase.CodeFilePath = test.Source.FullPath;
if (test.Source.Line.HasValue)
{
testCase.LineNumber = test.Source.Line.Value;
}
}
else
{
testCase.CodeFilePath = test.File.FullPath;
if (test.Line.HasValue)
{
testCase.LineNumber = test.Line.Value;
}
}
return testCase;
}