i want to disable all following Smart folders and Test cases in the current Test container.
Currently I am looping though all children, which include everything (TestCaseNodes, SmartFolderNodes, Recordings, ...)
Code: Select all
TestCaseNode currentTestcase = (TestCaseNode)TestSuite.CurrentTestContainer;
TestModuleLeaf currentLeaf = (TestModuleLeaf)TestModuleLeaf.Current;
var children = currentTestcase.Children;
int i = children.IndexOf(currentLeaf) + 1;
foreach (TestSuiteEntry child in children.Skip(i))
{
if ((child.GetType() == typeof(TestCaseNode)) || child.GetType() == typeof(SmartFolderNode)))
{
child.Checked= false;
}
}
Code: Select all
child.Checked = false;
Without splitting into separate IFs and casting, is there any elegant way to "just disable this item, regardless if it is a test case or a smart folder)?
thanks!