public void IsEdge_Throws_When_NullPassed_In_For_Source_Node() { var net = new BasicAdjList(Guid.NewGuid()); INode nodeA = null; INode nodeB = net.CreateNode(); var ex = Assert.Throws<ArgumentNullException>(() => net.IsEdge(nodeA, nodeB)); }
public void IsEdge_Throws_When_Invalid_Type_Passed_In_For_Dest_Node() { var net = new BasicAdjList(Guid.NewGuid()); INode nodeA = net.CreateNode(); INode nodeB = new DummyBasicNode(); var ex = Assert.Throws<ArgumentException>(() => net.IsEdge(nodeA, nodeB)); }
public void IsEdge_ReturnsTrueIfEdgeExistsBetweenTwoNodes() { //Arrange var net = new BasicAdjList(Guid.NewGuid()); INode nodeA = net.CreateNode(); INode nodeB = net.CreateNode(); IEdge edge = net.CreateEdge(nodeA, nodeB); bool result = net.IsEdge(nodeA, nodeB); Assert.True(result); }
public void IsEdge_ReturnsTrueFor_Self_Looped_Edges() { //Arrange var net = new BasicAdjList(Guid.NewGuid()); INode nodeA = net.CreateNode(); INode nodeB = net.CreateNode(); IEdge edge = net.CreateEdge(nodeB, nodeB); bool result = net.IsEdge(nodeB, nodeB); Assert.True(result); }
public void IsEdge_ReturnsFalseIf_Nodes_AreReversedButEdgeExists() { //Arrange var net = new BasicAdjList(Guid.NewGuid()); INode nodeA = net.CreateNode(); INode nodeB = net.CreateNode(); IEdge edge = net.CreateEdge(nodeA, nodeB); bool result = net.IsEdge(nodeB, nodeA); Assert.False(result); }
public void IsEdge_ReturnsFalseIfEdgeDNE() { //Arrange var net = new BasicAdjList(Guid.NewGuid()); INode nodeA = net.CreateNode(); INode nodeB = net.CreateNode(); INode nodeC = net.CreateNode(); IEdge edge = net.CreateEdge(nodeA, nodeB); bool result = net.IsEdge(nodeC, nodeA); Assert.False(result); }