public void PersonJohnGoEdge() { if (edgeWithPerson) { Person(); Mock.Scene.Selected.Clear(); } else { Mock.Scene.ClearView(); Mock.SetFocused(Mock.SampleFactory.Nodes[1]); // Person Mock.SceneFacade.Expand(false); Mock.CommandsPerform(); } Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Edges[3]); // [[Person->John]->Go] Mock.SceneFacade.Expand(false); Mock.CommandsPerform(); Mock.ReportScene(Mock.Scene); Mock.ProveLocationNotZero(FullExpanded.ToArray()); Mock.AreEquivalent(FullExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); }
public void Person() { Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[1]); // Person Mock.SceneFacade.CollapseToFocused(); Assert.AreEqual(Mock.Scene.Graph.Count, 1); Mock.AreEquivalent(new IVisual[] { Mock.SampleFactory.Nodes[1] }, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(PersonExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[5]); // Go Mock.SceneFacade.Expand(false); Mock.AreEquivalent(FullExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.RemoveOrphans = true; Mock.SceneFacade.Collapse(); Mock.AreEquivalent(PersonExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); this.ReportSummary(); }
public void SingleAddProgrammingLanguageNet() { Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[1]); // Programming Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.CollapseToFocused(); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Add(Mock.SampleFactory.Nodes[2], Point.Zero); // Language Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Add(Mock.SampleFactory.Nodes[4], Point.Zero); // .NET Mock.AreEquivalent(NetCollapsed, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); this.ReportSummary(); }
public void RemoveLibraries() { Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[1]); // Programming Mock.SceneFacade.CollapseToFocused(); Mock.CommandsPerform(); Mock.SceneFacade.Expand(false); Mock.CommandsPerform(); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[5]); // Libraries Mock.SceneFacade.Delete(); Mock.CommandsPerform(); var librariesRemoved = new IVisual[] { Mock.SampleFactory.Nodes[1], // Programming Mock.SampleFactory.Nodes[2], // Language Mock.SampleFactory.Edges[1], //[Programming->Language] Mock.SampleFactory.Nodes[3], // Java Mock.SampleFactory.Nodes[4], // .NET Mock.SampleFactory.Nodes[6], // Collections Mock.SampleFactory.Edges[2], //[[Programming->Language]->Java] Mock.SampleFactory.Edges[3], //[[Programming->Language]->.NET] }; Mock.AreEquivalent(librariesRemoved, Mock.Scene.Graph); Mock.ProveShapes(); Assert.IsNull(Mock.Scene.Focused); Assert.IsNull(Mock.Scene.Hovered); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[1]); // Programming Mock.SceneFacade.Collapse(); Mock.CommandsPerform(); Mock.SceneFacade.Expand(false); Mock.CommandsPerform(); Mock.AreEquivalent(librariesRemoved, Mock.Scene.Graph); Mock.ProveShapes(); }
public void ProgrammingLanguageEdge() { Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Edges[1]); // Programming Mock.SceneFacade.CollapseToFocused(); var programmingLanguageEdge = new IVisual[] { Mock.SampleFactory.Nodes[1], // Programming Mock.SampleFactory.Nodes[2], // Language Mock.SampleFactory.Edges[1], //[Programming->Language] }; Assert.AreEqual(Mock.Scene.Graph.Count, 3); Mock.AreEquivalent(programmingLanguageEdge, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); var programmingLanguageExpanded = new IVisual[] { Mock.SampleFactory.Nodes[1], // Programming Mock.SampleFactory.Nodes[2], // Language Mock.SampleFactory.Edges[1], //[Programming->Language] Mock.SampleFactory.Nodes[3], // Java Mock.SampleFactory.Nodes[4], // .NET Mock.SampleFactory.Edges[2], //[[Programming->Language]->Java] Mock.SampleFactory.Edges[3], //[[Programming->Language]->.NET] Mock.SampleFactory.Nodes[7], // List Mock.SampleFactory.Nodes[8], // IList Mock.SampleFactory.Edges[8], //[[[Programming->Language]->.NET]->IList] Mock.SampleFactory.Edges[9] //[[[Programming->Language]->Java]->List] }; Mock.SceneFacade.Expand(false); Mock.AreEquivalent(programmingLanguageExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Collapse(); Mock.AreEquivalent(programmingLanguageEdge, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); this.ReportSummary(); }
public void Net() { Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[4]); // .NET Mock.SceneFacade.CollapseToFocused(); Assert.AreEqual(1, Mock.Scene.Graph.Count); Mock.AreEquivalent(new IVisual[] { Mock.SampleFactory.Nodes[4] }, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); var netExpanded2 = new IVisual[] { Mock.SampleFactory.Nodes[1], // Programming Mock.SampleFactory.Nodes[2], // Language Mock.SampleFactory.Nodes[4], // .NET Mock.SampleFactory.Nodes[8], // IList Mock.SampleFactory.Edges[1], //[Programming->Language] Mock.SampleFactory.Edges[3], //[[Programming->Language]->.NET] Mock.SampleFactory.Edges[8], //[[[Programming->Language]->.NET]->IList] }; Mock.SceneFacade.Expand(false); Mock.AreEquivalent(netExpanded2, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Collapse(); Mock.AreEquivalent(NetCollapsed, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(netExpanded2, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[8]); //"IList" Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.Expand(false); var iListExpanded = new IVisual[] { Mock.SampleFactory.Nodes[1], // Programming Mock.SampleFactory.Nodes[2], // Language Mock.SampleFactory.Nodes[4], // .NET Mock.SampleFactory.Nodes[5], // Libraries Mock.SampleFactory.Nodes[6], // Collections Mock.SampleFactory.Nodes[8], // IList Mock.SampleFactory.Edges[1], // [Programming->Language] Mock.SampleFactory.Edges[3], // [[Programming->Language]->.NET] Mock.SampleFactory.Edges[4], // [Programming->Libraries] Mock.SampleFactory.Edges[5], // [[Programming->Libraries]->Collections] Mock.SampleFactory.Edges[7], // [[[Programming->Libraries]->Collections]->IList] Mock.SampleFactory.Edges[8], // [[[Programming->Language]->.NET]->IList] }; Mock.AreEquivalent(iListExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Collapse(); Mock.AreEquivalent(iListExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Edges[8]); // [[[Programming->Language]->.NET]->IList] Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.CollapseToFocused(); Mock.AreEquivalent(netExpanded2, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); this.ReportSummary(); }
public void Programming() { Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[1]); // Programming Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.CollapseToFocused(); Assert.AreEqual(Mock.Scene.Graph.Count, 1); Mock.AreEquivalent(new IVisual[] { Mock.SampleFactory.Nodes[1] }, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); // 1 Collapse - Expand - Cycle Mock.SceneFacade.Expand(false); Mock.AreEquivalent(ProgrammingExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); // 2 Collapse - Expand - Cycle Mock.SceneFacade.Collapse(); Mock.AreEquivalent(new IVisual[] { Mock.SampleFactory.Nodes[1] }, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(ProgrammingExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); // 3 Collapse - Expand - Cycle Mock.SceneFacade.Collapse(); Mock.AreEquivalent(new IVisual[] { Mock.SampleFactory.Nodes[1] }, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(ProgrammingExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[5]); //"Library" Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(ProgrammingExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[6]); //"Collections" Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(FullExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Collapse(); Mock.AreEquivalent(ProgrammingExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[4]); //"Net" Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(NetExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Collapse(); Mock.AreEquivalent(ProgrammingExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(NetExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[6]); //"Collections" Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.Collapse(); Mock.AreEquivalent(ProgrammingExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(FullExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[2]); //"Language" Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.Collapse(); Mock.AreEquivalent(languageCollapsed, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(FullExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[3]); //"Java" Mock.Display.Layout.Perform(Mock.Scene.Focused); Mock.SceneFacade.Collapse(); Mock.AreEquivalent(javaCollapsed, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(FullExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); this.ReportSummary(); }
public void N1() { Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[1]); // 1 Mock.SceneFacade.CollapseToFocused(); Assert.AreEqual(Mock.Scene.Graph.Count, 1); Mock.AreEquivalent(new IVisual[] { Mock.SampleFactory.Nodes[1] }, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); var N1Expanded = new IVisual[] { Mock.SampleFactory.Nodes[1], // 1 Mock.SampleFactory.Nodes[2], // 2 Mock.SampleFactory.Nodes[3], // 3 Mock.SampleFactory.Nodes[4], // 4 Mock.SampleFactory.Edges[1], // [1->2] Mock.SampleFactory.Edges[2], // [4->3] Mock.SampleFactory.Edges[3], // [1->[4->3]] }; Mock.SceneFacade.Expand(false); Mock.AreEquivalent(N1Expanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[4]); // 4 Mock.SceneFacade.Expand(false); var N4Expanded = new IVisual[] { Mock.SampleFactory.Nodes[1], // 1 Mock.SampleFactory.Nodes[2], // 2 Mock.SampleFactory.Nodes[3], // 3 Mock.SampleFactory.Nodes[4], // 4 Mock.SampleFactory.Nodes[5], // 3 Mock.SampleFactory.Nodes[8], // 4 Mock.SampleFactory.Edges[1], // [1->2] Mock.SampleFactory.Edges[2], // [4->3] Mock.SampleFactory.Edges[3], // [1->[4->3]] Mock.SampleFactory.Edges[4], // [5->8] Mock.SampleFactory.Edges[8], //[[4->3]->[5->8]] }; Mock.AreEquivalent(N4Expanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[5]); Mock.SceneFacade.Expand(false); var N5Expanded = new IVisual[] { Mock.SampleFactory.Nodes[1], // 1 Mock.SampleFactory.Nodes[2], // 2 Mock.SampleFactory.Nodes[3], // 3 Mock.SampleFactory.Nodes[4], // 4 Mock.SampleFactory.Nodes[5], // 5 Mock.SampleFactory.Nodes[6], // 6 Mock.SampleFactory.Nodes[7], // 7 Mock.SampleFactory.Nodes[8], // 8 Mock.SampleFactory.Edges[1], // [1->2] Mock.SampleFactory.Edges[2], // [4->3] Mock.SampleFactory.Edges[3], // [1->[4->3]] Mock.SampleFactory.Edges[4], // [5->8] Mock.SampleFactory.Edges[5], // [5->6] Mock.SampleFactory.Edges[6], //[5->7] Mock.SampleFactory.Edges[8], //[[4->3]->[5->8]] }; Mock.AreEquivalent(N5Expanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); var N5Collapsed = new IVisual[] { Mock.SampleFactory.Nodes[1], // 1 Mock.SampleFactory.Nodes[2], // 2 Mock.SampleFactory.Nodes[3], // 3 Mock.SampleFactory.Nodes[4], // 4 Mock.SampleFactory.Nodes[5], // 5 Mock.SampleFactory.Edges[1], // [1->2] Mock.SampleFactory.Edges[2], // [4->3] Mock.SampleFactory.Edges[3], // [1->[4->3]] }; Mock.SceneFacade.Collapse(); Mock.AreEquivalent(N5Collapsed, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(N5Expanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.Scene.Selected.Clear(); Mock.SetFocused(Mock.SampleFactory.Nodes[8]); Mock.SceneFacade.Expand(false); Mock.AreEquivalent(FullExpanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); Mock.SceneFacade.Collapse(); Mock.AreEquivalent(N5Expanded, Mock.Scene.Graph); Mock.ProveShapes(Mock.Scene); this.ReportSummary(); }