Esempio n. 1
0
        public void FindMinIntersectionDistance(
            string w1, string w2, int answer)
        {
            int x = new WiredPanel()
                    .FindMinIntersectionDistance(
                new Wire(w1), new Wire(w2));

            Assert.Equal(answer, x);
        }
Esempio n. 2
0
        public void FindMinSignalDelay(
            string w1, string w2, int answer)
        {
            int x = new WiredPanel()
                    .FindMinSignalDelay(
                new Wire(w1), new Wire(w2));

            Assert.Equal(answer, x);
        }
Esempio n. 3
0
        public void FindIntersections()
        {
            var wire1         = new Wire("R8,U5,L5,D3");
            var wire2         = new Wire("U7,R6,D4,L4");
            var intersections = new WiredPanel()
                                .FindIntersectionPoints(wire1, wire2)
                                .ToArray();

            Assert.Equal(2, intersections.Length);
            Assert.Contains((3, 3), intersections);
            Assert.Contains((6, 5), intersections);
        }