Пример #1
0
        public void Test_DayOnePartTwoExample()
        {
            var input = "199\n" +
                        "200\n" +
                        "208\n" +
                        "210\n" +
                        "200\n" +
                        "207\n" +
                        "240\n" +
                        "269\n" +
                        "260\n" +
                        "263";
            var sweeper = new SonarSweep(input.ToIntArray("\n").ToList());

            Assert.AreEqual(8, sweeper.Windows.Count());
            Assert.AreEqual(5, sweeper.GetIncreaseCount(sweeper.Windows));
        }
Пример #2
0
        public void Test_DayOnePartOneExample()
        {
            var input = "199\n" +
                        "200\n" +
                        "208\n" +
                        "210\n" +
                        "200\n" +
                        "207\n" +
                        "240\n" +
                        "269\n" +
                        "260\n" +
                        "263";
            var sweeper = new SonarSweep(input.ToIntArray("\n").ToList());

            Assert.AreEqual(10, sweeper.Measurements.Count());
            Assert.AreEqual(7, sweeper.GetIncreaseCount(sweeper.Measurements));
        }