public override void Populate( GuidTestTreeNodeDictionary nodes, TestTreeNode root, RunPipeStarterCollection pipes) { if (this.parentNode == null) { this.parentNode = new TestTreeNode("Categories", TestNodeType.Populator); root.Nodes.Add(this.parentNode); nodes.Add(this.parentNode); this.miscNode = this.addCategoryNodes(nodes, "Misc"); } foreach (RunPipeStarter starter in pipes) { if (TypeHelper.HasCustomAttribute( starter.Pipe.FixtureType, typeof(FixtureCategoryAttribute) )) { foreach (TestTreeNode categoryNode in this.categoryNodesFrom(nodes, starter.Pipe.FixtureType)) { TestTreeNode fixtureNode = addFixtureNode(nodes, categoryNode, starter); CreatePipeNode(nodes, fixtureNode, starter); } } else { TestTreeNode fixtureNode = addFixtureNode(nodes, this.miscNode, starter); CreatePipeNode(nodes, fixtureNode, starter); } } }
/// <summary> /// Populates the node using the <see cref="RunPipe"/> instance /// contained in <paramref name="pipes"/>. /// </summary> public override void Populate( GuidTestTreeNodeDictionary nodes, TestTreeNode rootNode, RunPipeStarterCollection pipes) { if (rootNode == null) { throw new ArgumentNullException("rootNode"); } if (pipes == null) { throw new ArgumentNullException("pipes"); } if (this.parentNode == null) { this.parentNode = new TestTreeNode("Namespaces", TestNodeType.Populator); rootNode.Nodes.Add(this.parentNode); nodes.Add(this.parentNode); } foreach (RunPipeStarter pipeStarter in pipes) { TestTreeNode namespaceNode = this.addNamespaceNodes(nodes, pipeStarter); // get fixture name TestTreeNode fixtureNode = this.addFixtureNode(nodes, namespaceNode, pipeStarter); CreatePipeNode(nodes, fixtureNode, pipeStarter); } }
private void AddPipe(Type t) { Fixture fixture1 = new Fixture( t, new MockRun(), null, null, false); RunPipeStarterCollection pipes = new RunPipeStarterCollection(fixture1); pipes.Add(new RunPipeStarter(new RunPipe(fixture1))); this.target.Populate(dic, root, pipes); }
public override void Populate( GuidTestTreeNodeDictionary nodes, TestTreeNode rootNode, RunPipeStarterCollection pipes ) { if (rootNode == null) { throw new ArgumentNullException("rootNode"); } if (pipes == null) { throw new ArgumentNullException("pipes"); } if (this.parentNode == null) { this.parentNode = new TestTreeNode("Importances", TestNodeType.Populator); rootNode.Nodes.Add(this.parentNode); nodes.Add(this.parentNode); // adding nodes foreach (TestImportance ti in Enum.GetValues(typeof(TestImportance))) { this.addImportance(nodes, ti); } // add unknown Importance anonymous = this.addImportance(nodes, TestImportance.Default); } foreach (RunPipeStarter pipeStarter in pipes) { // get Importance attribute TestTreeNode node = null; if (TypeHelper.HasCustomAttribute(pipeStarter.Pipe.FixtureType, typeof(ImportanceAttribute))) { ImportanceAttribute Importance = (ImportanceAttribute)TypeHelper.GetFirstCustomAttribute( pipeStarter.Pipe.FixtureType, typeof(ImportanceAttribute)); node = addImportance(nodes, Importance.Importance); } else { node = anonymous; } TestTreeNode fixtureNode = addFixtureNode(nodes, node, pipeStarter); CreatePipeNode(nodes, fixtureNode, pipeStarter); } }
public Fixture(Type type, IRun run, MethodInfo setUp, MethodInfo tearDown, bool ignored) { if (type == null) { throw new ArgumentNullException("type"); } if (run == null) { throw new ArgumentNullException("run"); } this.type = type; ReflectionAssert.HasDefaultConstructor(this.type); this.run = run; this.setUp = setUp; this.tearDown = tearDown; this.ignored = ignored; this.starters = new RunPipeStarterCollection(this); }
/// <summary> /// Populates the node using the <see cref="RunPipe"/> instance /// contained in <paramref name="pipes"/>. /// </summary> /// <param name="nodes">Node dictionary.</param> /// <param name="root">The root node.</param> /// <param name="pipes">Collection of <see cref="RunPipeStarter"/>s</param> /// <exception cref="ArgumentNullException"> /// <paramref name="root"/> or <paramref name="pipes"/> is a null /// reference (Nothing in Visual Basic) /// </exception> public abstract void Populate(GuidTestTreeNodeDictionary nodes, TestTreeNode root, RunPipeStarterCollection pipes);