本文整理汇总了C#中Suite.AddTest方法的典型用法代码示例。如果您正苦于以下问题:C# Suite.AddTest方法的具体用法?C# Suite.AddTest怎么用?C# Suite.AddTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Suite
的用法示例。
在下文中一共展示了Suite.AddTest方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: adding_a_test_to_a_suite_sets_the_suite_as_the_tests_parent
public void adding_a_test_to_a_suite_sets_the_suite_as_the_tests_parent()
{
var suite = new Suite("Suite 1");
var test = new Test("Test 1");
suite.AddTest(test);
test.Parent.ShouldEqual(suite);
suite.Contains(test).ShouldBeTrue();
}
示例2: loadTestsInFolder
private void loadTestsInFolder(string folder, Suite parent)
{
foreach (string file in _system.GetFiles(folder, "xml"))
{
Test test = LazyTestXmlReader.ReadFromFile(file);
parent.AddTest(test);
}
// load the tests from the sub folders
foreach (string subFolder in _system.GetSubFolders(folder))
{
string name = Path.GetFileName(subFolder);
var child = parent is Hierarchy ? new WorkspaceSuite(name){Filter = _project.WorkspaceFor(name)} : new Suite(name);
parent.AddSuite(child);
loadTestsInFolder(subFolder, child);
}
}
示例3: loadTestsInFolder
private void loadTestsInFolder(string folder, Suite parent)
{
foreach (string file in _system.GetFiles(folder, "xml"))
{
Test test = LazyTestXmlReader.ReadFromFile(file);
test.SetParent(parent);
parent.AddTest(test);
}
// load the tests from the sub folders
foreach (string subFolder in _system.GetSubFolders(folder))
{
string name = Path.GetFileName(subFolder);
var child = new Suite(name) {Parent = parent};
parent.AddSuite(child);
loadTestsInFolder(subFolder, child);
}
}
示例4: get_path_with_parent
public void get_path_with_parent()
{
var suite = new Suite("s1");
var test = new Test("t1");
suite.AddTest(test);
test.GetPath().Locator.ShouldEqual("s1/t1");
}
示例5: return_the_workspace_filter_from_the_ultimate_parent_suite
public void return_the_workspace_filter_from_the_ultimate_parent_suite()
{
var workspaceSuite = new WorkspaceSuite("suite")
{
Filter = new WorkspaceFilter()
{
Filters = new FixtureFilter[] { FixtureFilter.Namespace("NS1") }
}
};
var test = new Test("something");
var suite = new Suite("a suite");
suite.AddTest(test);
workspaceSuite.AddSuite(suite);
test.GetWorkspace().ShouldBeTheSameAs(workspaceSuite.Filter);
}
示例6: loadTestsInFolder
private void loadTestsInFolder(string folder, Suite parent)
{
foreach (string file in _system.GetFiles(folder, "xml"))
{
Test test = _reader.ReadFromFile(file);
parent.AddTest(test);
}
// load the tests from the sub folders
foreach (string subFolder in _system.GetSubFolders(folder))
{
var child = new Suite(Path.GetFileName(subFolder));
parent.AddSuite(child);
loadTestsInFolder(subFolder, child);
}
}