public void LayerInstruction_WithObjectLinkFromStrings_IsCorrect()
        {
            var layer = LayerInstruction.FromStrings(CreateLines(
                                                         "Layer: Size=(5,5)",
                                                         "Room: (0,0)", "Floor: (1,1)", "Floor: (1,2)", "Link:(Floor,1,1)-(Floor,1,2)"));

            Assert.AreEqual(1, layer.Links.Count);
        }
Beispiel #2
0
        public void LayerAssembler_AssembleSimpleLayerWithRoomOffset_LayerCorrect()
        {
            var instructions = LayerInstruction.FromStrings(CreateLines("Layer:Size=(5,5)", "Room:(2,2)", "Floor:(1,1)"));

            var layer = LayerBuilder.Assemble(instructions);

            Assert.AreEqual("Floor", layer[3, 3].Ground.Type);
        }
        public void LayerInstruction_OneRoomFromStrings_IsCorrect()
        {
            var layer = LayerInstruction.FromStrings(CreateLines(
                                                         "Layer: Size=(3,3)", "Room: (0,0)", "Floor: (1,1)"));

            Assert.AreEqual(1, layer.Rooms.Count);
            Assert.AreEqual(new XY(0, 0), layer.Rooms[0].Location);
            Assert.AreEqual(1, layer.Rooms[0].ObjectInstructions.Count);
        }
Beispiel #4
0
        public void LayerAssembler_AssembleSimpleLayerWithObjectLink_LayerCorrect()
        {
            var instructions = LayerInstruction.FromStrings(CreateLines("Layer:Size=(3,3)",
                                                                        "Room: (0,0)", "Table:(1,1)", "Table:(1,2)", "Link:(Table,1,1)-(Table,1,2)"));

            var layer = LayerBuilder.Assemble(instructions);

            Assert.AreEqual(1, layer[1, 1].LowerObject.LinkedObjs.Count);
            Assert.AreEqual(1, layer[1, 2].LowerObject.LinkedObjs.Count);
        }
        public void LayerInstruction_EmptyLayerWithSize_SizeCorrect()
        {
            var layer = LayerInstruction.FromStrings(CreateLines("Layer: Size=(4,5)"));

            Assert.AreEqual(new XY(4, 5), layer.Size);
        }
 public void LayerInstruction_InvalidLines_ThrowsArgumentException()
 {
     ExceptionAssert.Throws <ArgumentException>(() => LayerInstruction.FromStrings(CreateLines()));
     ExceptionAssert.Throws <ArgumentException>(() => LayerInstruction.FromStrings(CreateLines("Room: (0,0)", "Floor: (1,1)")));
 }