Пример #1
0
        public void CheckThatJetEngineCannotBePlacedOnLineIfInterferingBlocksExist()
        {
            jetEngine = new JetEngine(mockBlock.Object, edgeTypeLine);
            var position = new Coordinate(4, 5);
            var existing = new Coordinate(2, 5);

            mockBlueprint.SetupGet(x => x.Dimensions).Returns(new Coordinate(10, 11));
            mockBlueprint.Setup(x => x.HasBlock(existing)).Returns(true);

            Assert.IsFalse(jetEngine.CanBePlaced(mockBlueprint.Object, position));
        }
Пример #2
0
        public void CheckThatJetEngineCanBePlacedIfItDoesntInterfereWithAnyBlocks()
        {
            jetEngine = new JetEngine(mockBlock.Object, edgeTypeColumn);
            var position         = new Coordinate(4, 5);
            var existingOnColumn = new Coordinate(4, 4);
            var existingOnLine   = new Coordinate(6, 5);

            mockBlueprint.SetupGet(x => x.Dimensions).Returns(new Coordinate(10, 11));
            mockBlueprint.Setup(x => x.HasBlock(existingOnColumn)).Returns(true);
            mockBlueprint.Setup(x => x.HasBlock(existingOnLine)).Returns(true);

            Assert.IsTrue(jetEngine.CanBePlaced(mockBlueprint.Object, position));
        }