Ejemplo n.º 1
0
        public void DoubleEdgedPipeAreEqualToReverseCounterpart()
        {
            var pipe  = new PipePosition(new Coordinate(1, 2), EdgeType.LEFT, EdgeType.RIGHT);
            var other = new PipePosition(new Coordinate(1, 2), EdgeType.RIGHT, EdgeType.LEFT);

            Assert.IsTrue(pipe == other);
            Assert.IsFalse(pipe != other);
        }
Ejemplo n.º 2
0
        public void CheckDoubleEdgedPipePositionEqualities()
        {
            var pipe  = new PipePosition(new Coordinate(1, 2), EdgeType.LEFT, EdgeType.RIGHT);
            var other = new PipePosition(new Coordinate(3, 2), EdgeType.LEFT, EdgeType.RIGHT);

            Assert.IsFalse(pipe == other);
            Assert.IsTrue(pipe != other);
        }
Ejemplo n.º 3
0
        public void CheckIfPipeIsSetCorrectly()
        {
            var position = new Coordinate(1, 4);

            objectTable.SetPipe(position, EdgeType.LEFT, EdgeType.RIGHT, mockBuilderObject.Object);

            var pipePosition = new PipePosition(position, EdgeType.LEFT, EdgeType.RIGHT);

            Assert.AreEqual(mockBuilderObject.Object, doubleEdgedPipes[pipePosition]);
        }
Ejemplo n.º 4
0
        public void CheckIfConnectingPipeIsDeletedCorrectly()
        {
            var position = new Coordinate(2, 3);
            var pipe     = new ConnectingPipe(EdgeType.DOWN);
            var key      = new PipePosition(position, pipe.Edge, EdgeType.COUNT);

            doubleEdgedPipes.Add(key, mockPipe.Object);
            blueprintBuilderViewModel.ConnectingPipeDeleted(mockBlueprint.Object, position, pipe);
            Assert.IsFalse(doubleEdgedPipes.ContainsKey(key));
        }
Ejemplo n.º 5
0
        public void CheckIfDoubleEdgedPipeIsDeletedCorrectly()
        {
            var position = new Coordinate(2, 3);
            var pipe     = new DoubleEdgedPipe(EdgeType.DOWN, EdgeType.UP);
            var key      = new PipePosition(position, pipe.FirstEdge, pipe.SecondEdge);

            doubleEdgedPipes.Add(key, mockPipe.Object);
            blueprintBuilderViewModel.DoubleEdgePipeDeleted(mockBlueprint.Object, position, pipe);
            Assert.IsFalse(doubleEdgedPipes.ContainsKey(key));
        }
Ejemplo n.º 6
0
        public void CheckIfPipeIsDeletedCorrectly()
        {
            var position = new Coordinate(1, 4);
            var key      = new PipePosition(position, EdgeType.LEFT, EdgeType.RIGHT);

            doubleEdgedPipes.Add(key, mockBuilderObject.Object);
            objectTable.DeletePipe(position, EdgeType.LEFT, EdgeType.RIGHT);

            Assert.IsFalse(doubleEdgedPipes.ContainsKey(key));
            mockBuilderObject.Verify(mock => mock.Delete(), Times.Once());
        }