public void Resolve() { if (resolved) { return; } if (Tree.Inner != null) { var node = new TestNodeInternal(Tree.Inner.Host); var innerPath = new TestPath(Path, node); innerNode = new TestPathTreeNode(Tree.Inner, innerPath, node); return; } children = new List <TestPathTreeNode> (); foreach (var child in Tree.Builder.Children) { var node = new TestNodeInternal(child.Host, child.Parameter); var childPath = new TestPath(Path, node); children.Add(new TestPathTreeNode(child.TreeRoot, childPath, node)); } resolved = true; }
public TestPath GetCurrentPath() { if (currentPath != null) { return(currentPath); } var node = new TestNodeInternal(Instance.Host, Parameter); currentPath = new TestPath(Instance.ParentPath, node); return(currentPath); }
public IPathResolver Resolve(TestContext ctx, TestNode node) { Resolve(ctx); if (innerNode != null) { innerNode.Resolve(ctx); if (!TestNodeInternal.Matches(innerNode.Tree.Host, node)) { throw new InternalErrorException(); } if (node.ParameterValue != null) { return(innerNode.Parameterize(node.ParameterValue)); } return(innerNode); } if (node.ParameterValue == null) { throw new InternalErrorException(); } foreach (var child in children) { if (!TestNodeInternal.Matches(child.Node, node)) { throw new InternalErrorException(); } if (!node.ParameterValue.Equals(child.Node.Parameter.Value)) { continue; } return(child); } throw new InternalErrorException(); }
public TestPathTreeNode(TestPathTree tree, TestPath path) { Tree = tree; Path = path; Node = (TestNodeInternal)path.Node; }
public TestPathTreeNode(TestPathTree tree, TestPath path, TestNodeInternal node) { Tree = tree; Path = path; Node = node; }
public static bool Matches(TestHost host, TestNode second) { var hostNode = new TestNodeInternal(host); return(Matches(hostNode, second)); }