Esempio n. 1
0
        public void Test13()
        {
            const string layout = @"#.##.##.##
#######.##
#.#.#..#..
####.##.##
#.##.##.##
#.#####.##
..#.#.....
##########
#.######.#
#.#####.##";

            var sut = new WaitingArea(layout);

            sut.AddPassengersWith(new ShyBehaviour());

            Assert.Equal(@"#.LL.LL.L#
#LLLLLL.LL
L.L.L..L..
LLLL.LL.LL
L.LL.LL.LL
L.LLLLL.LL
..L.L.....
LLLLLLLLL#
#.LLLLLL.L
#.LLLLL.L#", sut.Layout);
        }
Esempio n. 2
0
        public void Test12()
        {
            var layout = @"L.LL.LL.LL
LLLLLLL.LL
L.L.L..L..
LLLL.LL.LL
L.LL.LL.LL
L.LLLLL.LL
..L.L.....
LLLLLLLLLL
L.LLLLLL.L
L.LLLLL.LL";

            var sut = new WaitingArea(layout);

            sut.AddPassengersWith(new ShyBehaviour());

            Assert.Equal(@"#.##.##.##
#######.##
#.#.#..#..
####.##.##
#.##.##.##
#.#####.##
..#.#.....
##########
#.######.#
#.#####.##", sut.Layout);
        }
Esempio n. 3
0
        public void UpdateLayout_WhenPassengersArrive(string layout, string expectedLayout)
        {
            var sut = new WaitingArea(layout);

            sut.AddPassengersWith(new NormalBehaviour());
            Assert.Equal(expectedLayout, sut.Layout);
        }
Esempio n. 4
0
        public void CalculateOccupiedSeats_AfterReceivingPassengers()
        {
            const string layout = @"#.#L.L#.##
#LLL#LL.L#
L.#.L..#..
#L##.##.L#
#.#L.LL.LL
#.#L#L#.##
..L.L.....
#L#L##L#L#
#.LLLLLL.L
#.#L#L#.##";

            var sut = new WaitingArea(layout);

            sut.AddPassengersWith(new NormalBehaviour());
            Assert.Equal(37, sut.OccupiedSeats);
        }
Esempio n. 5
0
        public void ReturnSameLayout_WhenMaximumCombinationsAreReached()
        {
            const string layout = @"#.#L.L#.##
#LLL#LL.L#
L.#.L..#..
#L##.##.L#
#.#L.LL.LL
#.#L#L#.##
..L.L.....
#L#L##L#L#
#.LLLLLL.L
#.#L#L#.##";

            var sut = new WaitingArea(layout);

            sut.AddPassengersWith(new NormalBehaviour());
            Assert.Equal(layout, sut.Layout);
        }