public void CanSortReturnsWhetherGraphCanBeSorted2() { // {41, 51, 61, 100}, // {42, 52, 62, 100}, var graph = GraphTestHelper.CreateSimpleGraph(TargetGraph); Assert.True(graph.CanSort()); graph.AddSequences(new[] { new[] { 100, 41 }, }); Assert.False(graph.CanSort()); }
public void AddAddsExistingSequence() { // {41, 51, 61, 100}, // {42, 52, 62, 100}, var graph = GraphTestHelper.CreateSimpleGraph(TargetGraph); Assert.AreEqual(7, graph.CountNodes); graph.AddSequence(new[] { 51, 61 }); graph.AddSequence(new[] { 42, 52 }); Assert.AreEqual(7, graph.CountNodes); GraphTestHelper.AssertConsistsOfSequences(graph, new[] { new[] { 41, 51 }, new[] { 51, 61 }, new[] { 61, 100 }, new[] { 42, 52 }, new[] { 52, 62 }, new[] { 62, 100 }, new[] { 41, 51, 61, 100 }, new[] { 42, 52, 62, 100 }, }); }
public void CanSortReturnsWhetherGraphWithTheSequenceCanBeSorted2() { var graph = GraphTestHelper.CreateSimpleGraph(TargetGraph); Assert.False(graph.CanSort(new[] { 100, 41 })); }
public void CanSortReturnsWhetherGraphWithTheSequenceCanBeSorted1() { var graph = GraphTestHelper.CreateSimpleGraph(TargetGraph); Assert.True(graph.CanSort(new[] { 43, 52, 63, 100 })); }
public void CanSortReturnsWhetherGraphCanBeSorted1() { var graph = GraphTestHelper.CreateSimpleGraph(TargetGraph); Assert.True(graph.CanSort()); }