예제 #1
0
        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));
        }
예제 #2
0
        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);
        }
예제 #3
0
        public void GetOtherPartitionCannotAcceptNull()
        {
            var edge = new PartitionEdge(new PartitionEntityFactory());

            Assert.Throws(typeof(ArgumentNullException), () => edge.GetOtherPartition((IPartition)null));
        }