public OutlineNode(ITestPart part, Icon icon) { Focusable = true; Part = part; IsExpanded = true; Holder = part as IPartHolder; Header = new StackPanel().Horizontal().Configure(x => { _textBlock = x.Add<TextBlock>(); }); Icon = icon; this.BindControlAnd(Key.M).To(() => { if (ContextMenu != null) { ContextMenu.PlacementTarget = this; ContextMenu.VerticalOffset = 5; ContextMenu.HorizontalOffset = 20; ContextMenu.Placement = PlacementMode.RelativePoint; ContextMenu.IsOpen = true; } }); }
public OutlineNode(ITestPart part, Icon icon) { Focusable = true; Part = part; IsExpanded = true; Holder = part as IPartHolder; Header = new StackPanel().Horizontal().Configure(x => { _image = x.Add <Image>(); }); Icon = icon; this.BindControlAnd(Key.M).To(() => { if (ContextMenu != null) { ContextMenu.PlacementTarget = this; ContextMenu.VerticalOffset = 5; ContextMenu.HorizontalOffset = 20; ContextMenu.Placement = PlacementMode.RelativePoint; ContextMenu.IsOpen = true; } }); }
public void SelectNodeFor(ITestPart part) { //_topNode.Parent.CallOn<UIElement>(e => e.Focus()); //moveNext(); //moveNext(); //moveNext(); //moveNext(); //moveNext(); _topNode.IsSelected = false; var parent = _topNode.Parent as UIElement; parent.Focus(); parent.InvalidateVisual(); OutlineNode node = _topNode.Find(n => n.Part == part); node.BringIntoView(); node.IsSelected = true; node.Focus(); //node.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); //moveNext(); return; //_topNode.Parent.CallOn<UIElement>(e => e.Focus()); node.Focus(); //parent.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); //Keyboard.FocusedElement.As<UIElement>().MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); //Keyboard.FocusedElement.As<UIElement>().MoveFocus(new TraversalRequest(FocusNavigationDirection.Previous)); //node.IsSelected = true; //node.Focus(); //_topNode.Parent.CallOn<UIElement>(e => e.Focus()); }
protected void assertCurrentNode(ITestPart part, Icon icon, string text) { OutlineNode outlineNode = treeBuilder.LastNode; outlineNode.Part.ShouldBeTheSameAs(part); outlineNode.Icon.ShouldEqual(icon); outlineNode.HeaderText().ShouldEqual(text); }
public void ConfigureRearrangeCommands(OutlineNode node, IPartHolder holder, ITestPart part) { node.BindControlAnd(Key.Up).To(() => _controller.MoveUp(part, holder)).Menu("Move Up", Icon.UpArrow); node.BindControlAnd(Key.PageUp).To(() => _controller.MoveToTop(part, holder)).Menu("Move to Top", Icon.UpArrow); node.BindControlAnd(Key.Down).To(() => _controller.MoveDown(part, holder)).Menu("Move Down", Icon.DownArrow); node.BindControlAnd(Key.PageDown).To(() => _controller.MoveToBottom(part, holder)).Menu("Move to Bottom", Icon.DownArrow); node.Bind(Key.Delete).To(() => _controller.Remove(part, holder)).Menu("Delete", Icon.Delete); }
private void withNewLeaf(ITestPart part, Icon icon, Action <OutlineNode> configure) { var node = new OutlineNode(part, icon); configure(node); CurrentNode.Items.Add(node); LastNode = node; }
public void ExecuteWithFixture <T>(StepLeaf leaf, ITestPart exceptionTarget) where T : IFixture { LoadFixture <T>(exceptionTarget); leaf.AcceptVisitor(this); RevertFixture(exceptionTarget); }
public void LoadFixture <T>(ITestPart part) where T : IFixture { var fixture = RetrieveFixture <T>(); LoadFixture(fixture, part); }
private void addChildSteps(IStep parent, INode sectionNode) { StepLeaf childSteps = parent.LeafFor(sectionNode.Name); sectionNode.ForEachChild(childStepNode => { ITestPart child = ReadPart(childStepNode); childSteps.Add(child); }); }
private Token tokenFor(ITestPart part) { Token token = _tokens.Find(t => t.Part == part); if (token == null) { throw new ArgumentOutOfRangeException("Could not find this Part in the TokenizedTest"); } return(token); }
public void LoadFixture(IFixture fixture, ITestPart part) { if (part == null) { throw new ArgumentNullException("part"); } performAction(part, () => fixture.SetUp(this)); _fixtures.Push(fixture); }
public int OneBasedIndexOf(ITestPart part) { int index = _tokens.FindIndex(t => t.Part == part); if (index >= 0) { return(index + 1); } throw new ArgumentOutOfRangeException("Could not find this Part in the TokenizedTest"); }
public Section ReadSection(INode element) { var section = new Section(element.Name); var adder = new SectionAdder(section); element.ForEachChild(node => { ITestPart part = ReadPart(node); part.AcceptVisitor(adder); }); return(section); }
private void performAction(ITestPart part, Action continuation) { try { continuation(); } catch (Exception ex) { _listener.Exception(ex.ToString()); IncrementExceptions(); ResultsFor(part).CaptureException(ex.ToString()); } }
public void LoadFixture(string fixtureKey, ITestPart part) { var results = ResultsFor(part); try { var fixture = _container.GetInstance <IFixture>(fixtureKey); LoadFixture(fixture, part); } catch (StructureMapException e) { _fixtureIsInvalid = true; _listener.Exception(e.ToString()); if (e.ErrorCode == 200) { results.CaptureException("Unable to find a Fixture named '{0}'".ToFormat(fixtureKey)); IncrementSyntaxErrors(); } else { IncrementExceptions(); if (e.InnerException != null) { results.CaptureException(e.InnerException.ToString()); } else { results.CaptureException(e.ToString()); } } } catch (Exception e) { _fixtureIsInvalid = true; _listener.Exception(e.ToString()); results.CaptureException(e.ToString()); IncrementExceptions(); } }
public void RevertFixture(ITestPart part) { if (_fixtureIsInvalid) { _fixtureIsInvalid = false; return; } if (part == null) { throw new ArgumentNullException("part"); } IFixture fixture = _fixtures.Pop(); if (fixture != null) { performAction(part, fixture.TearDown); } _fixtureIsInvalid = false; }
public void Remove(ITestPart part, IPartHolder holder) { configure(holder, h => h.Remove(part)); }
public virtual void FinishPart(ITestPart part) { _progression.IncrementProgress(part); Publish(); }
public void MoveUp(ITestPart part, IPartHolder holder) { configure(holder, h => h.MoveUp(part)); _treeService.SelectNodeFor(part); }
public static void Add(this IPartHolder holder, ITestPart part) { holder.Parts.Add(part); }
public string PathOf(ITestPart part) { Token token = tokenFor(part); return(token.Description); }
public static void MoveDown(this IPartHolder holder, ITestPart part) { holder.Parts.MoveDown(part); }
public static void Remove(this IPartHolder holder, ITestPart part) { holder.Parts.Remove(part); }
public void IncrementProgress(ITestPart part) { _progress++; }
public void ExecuteWithFixture <T>(StepLeaf leaf, ITestPart exceptionTarget) where T : IFixture { }
public StepResults ResultsFor(ITestPart part) { return(_results[part]); }
public void Add(ITestPart testPart) { _parts.Add(testPart); }
private void withNewNode(ITestPart part, Icon icon, Action<OutlineNode> configure) { var node = new OutlineNode(part, icon); configure(node); CurrentNode.Items.Add(node); LastNode = node; _nodes.Push(node); }
public static void MoveToBottom(this IPartHolder holder, ITestPart part) { holder.Parts.MoveToBottom(part); }
public static void MoveUp(this IPartHolder holder, ITestPart part) { holder.Parts.MoveUp(part); }
public void Start(ITestPart part) { _current = tokenFor(part); }
public void Add(ITestPart part) { _parts.Add(part); }
public virtual void StartPart(ITestPart part) { _progression.Start(part); Publish(); }
public void Add(ITestPart testPart) { inner.Add(testPart); }
public void MoveToBottom(ITestPart part, IPartHolder holder) { configure(holder, h => h.MoveToBottom(part)); _treeService.SelectNodeFor(part); }