コード例 #1
0
        public void Reports_AddTo2020_Product(string input, int preamble, long expected)
        {
            XMAS x       = new XMAS(input);
            long invalid = x.FindWeakness(preamble);

            Assert.Equal(expected, invalid);
        }
コード例 #2
0
        public void Example3()
        {
            var xmas = new XMAS(5);

            xmas.AddRange(ExampleNumbers2);
            Assert.AreEqual(new[] { 15, 25, 47, 40 }, xmas.FindContiguousSum(127));
            Assert.AreEqual(62, xmas.FindWeakness(127));
        }