예제 #1
0
        public static void FixedTesting(string s)
        {
            var ssp = s.Split(" -> ");

            int[][] inp = ssp[0].Substring(2, ssp[0].Length - 4).Split("},{", StringSplitOptions.RemoveEmptyEntries).Select(e => convrt(e)).ToArray();
            int[]   sol = convrt(ssp[1]);
            Assert.That(DnB.DotsAndBoxes(inp), Is.EqualTo(sol));
        }
예제 #2
0
파일: DnBTest.cs 프로젝트: san-had/codewars
        public void DnBBaseTest()
        {
            var moves = new int[][]
            {
                new[] { 0, 1 },
                new[] { 7, 8 },
                new[] { 1, 2 },
                new[] { 6, 7 },
                new[] { 0, 3 },
                new[] { 8, 5 },
                new[] { 3, 4 },
                new[] { 4, 1 },
                new[] { 4, 5 },
                new[] { 2, 5 },
                new[] { 7, 4 },
                new[] { 3, 6 }
            };
            var expected = new int[2] {
                3, 1
            };
            var actual = DnB.DotsAndBoxes(moves);

            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public static void RandomTesting(int[][] r)
        {
            var ref_sol = ref_func(r);

            Assert.That(DnB.DotsAndBoxes(r), Is.EqualTo(ref_sol), "Hello");
        }