public void GetOtherPartitionReturnsTheCorrectPartition() { var factory = new PartitionEntityFactory(); PartitionNode nodeA = new PartitionNode(factory); PartitionNode nodeB = new PartitionNode(factory); IPartition p1, p2; nodeA.Partition = p1 = new DMT.Partition.Data.Partition(factory);; nodeB.Partition = p2 = new DMT.Partition.Data.Partition(factory);; PartitionEdge edge = new PartitionEdge(nodeA, nodeB, Core.Interfaces.EdgeDirection.Both, factory); nodeA.ConnectTo(nodeB, edge); Assert.Equal(p2, edge.GetOtherPartition(p1)); }
public void IsInnerReturnsTrueOnlyForInnerEdges() { var factory = new PartitionEntityFactory(); IPartition partition = new DMT.Partition.Data.Partition(factory); PartitionNode nodeA = new PartitionNode(factory); PartitionNode nodeB = new PartitionNode(factory); nodeA.Partition = partition; nodeB.Partition = partition; PartitionEdge edge = new PartitionEdge(nodeA, nodeB, Core.Interfaces.EdgeDirection.Both, factory); nodeA.ConnectTo(nodeB, edge); Assert.True(edge.IsInner); }