Exemplo n.º 1
0
        public void GetBranchArmsT()
        {
            TestFloorPlan floorPlan;
            {
                Rect[] rooms = new Rect[]
                {
                    new Rect(3, 7, 2, 2),
                    new Rect(3, 5, 2, 2),
                    new Rect(3, 3, 2, 2),
                    new Rect(3, 9, 2, 2),
                    new Rect(3, 11, 2, 2),
                    new Rect(5, 7, 2, 2),
                    new Rect(7, 7, 2, 2),
                };
                var links = new Tuple <char, char>[]
                {
                    Tuple.Create('A', 'B'),
                    Tuple.Create('B', 'C'),
                    Tuple.Create('A', 'D'),
                    Tuple.Create('D', 'E'),
                    Tuple.Create('A', 'F'),
                    Tuple.Create('F', 'G'),
                };
                floorPlan = TestFloorPlan.InitFloorToContext(new Loc(22, 14), rooms, Array.Empty <Rect>(), links);
            }

            var expectedArms = new List <List <RoomHallIndex> >();
            var arm          = new List <RoomHallIndex>
            {
                new RoomHallIndex(2, false),
                new RoomHallIndex(1, false),
            };

            expectedArms.Add(arm);
            arm = new List <RoomHallIndex>
            {
                new RoomHallIndex(4, false),
                new RoomHallIndex(3, false),
            };
            expectedArms.Add(arm);
            arm = new List <RoomHallIndex>
            {
                new RoomHallIndex(6, false),
                new RoomHallIndex(5, false),
            };
            expectedArms.Add(arm);

            List <List <RoomHallIndex> > arms = ConnectBranchTestStep.GetBranchArms(floorPlan);

            Assert.That(arms, Is.EqualTo(expectedArms));
        }
Exemplo n.º 2
0
        public void GetBranchArmsSingle()
        {
            TestFloorPlan floorPlan = TestFloorPlan.InitFloorToContext(
                new Loc(22, 14),
                new Rect[] { new Rect(3, 3, 2, 2) },
                Array.Empty <Rect>(),
                Array.Empty <Tuple <char, char> >());

            List <List <RoomHallIndex> > expectedArms = new List <List <RoomHallIndex> >();

            List <List <RoomHallIndex> > arms = ConnectBranchTestStep.GetBranchArms(floorPlan);

            Assert.That(arms, Is.EqualTo(expectedArms));
        }
Exemplo n.º 3
0
        public void GetBranchArmsHall()
        {
            TestFloorPlan floorPlan = TestFloorPlan.InitFloorToContext(
                new Loc(22, 14),
                new Rect[] { new Rect(3, 3, 2, 2), new Rect(3, 7, 2, 2) },
                new Rect[] { new Rect(3, 5, 2, 2) },
                new Tuple <char, char>[] { Tuple.Create('A', 'a'), Tuple.Create('a', 'B') });

            var expectedArms = new List <List <RoomHallIndex> >();
            var arm          = new List <RoomHallIndex>
            {
                new RoomHallIndex(0, false),
                new RoomHallIndex(0, true),
                new RoomHallIndex(1, false),
            };

            expectedArms.Add(arm);

            List <List <RoomHallIndex> > arms = ConnectBranchTestStep.GetBranchArms(floorPlan);

            Assert.That(arms, Is.EqualTo(expectedArms));
        }