예제 #1
0
        public void Day24_LobbyLayout_Part1_ok()
        {
            var lines = DailyDataUtilities.ReadLinesFromFile("Day24Data.Txt");

            Assert.Equal(471, lines.Length);

            var sut = new LobbyLayout();

            sut.ProcessDirections(lines);
            var actual = sut.CountBlackTiles();

            Assert.Equal(411, actual);
            Assert.Equal(441, sut.Tiles.Count);
        }
예제 #2
0
        public void Day24_ReadDataExample1_ok()
        {
            var lines = DailyDataUtilities.ReadLinesFromFile("Day24Example1Data.Txt");

            Assert.Equal(20, lines.Length);

            var sut = new LobbyLayout();

            sut.ProcessDirections(lines);
            var actual = sut.CountBlackTiles();

            Assert.Equal(10, actual);
            Assert.Equal(15, sut.Tiles.Count);
        }
예제 #3
0
        public void Day24_GenerationsExample_ok(int days, int expected)
        {
            var lines = DailyDataUtilities.ReadLinesFromFile("Day24Example1Data.Txt");

            Assert.Equal(20, lines.Length);

            var sut = new LobbyLayout();

            sut.ProcessDirections(lines);
            var actual = sut.CountBlackTiles();

            Assert.Equal(10, actual);
            Assert.Equal(15, sut.Tiles.Count);
            for (int i = 0; i < days; i++)
            {
                sut.ProcessGeneration();
            }
            actual = sut.CountBlackTiles();
            Assert.Equal(expected, actual);
        }