public void TestSameLineRoute()
        {
            var greenRoute = _searchStationService.FindKShortestPath("Joo Koon", "Jurong East", 3);
            var greenLine  = new String[] { "Jurong East", "Chinese Garden", "Lakeside", "Boon Lay", "Pioneer", "Joo Koon" };

            Assert.IsTrue(TestUtility.IsSameRoute(greenLine, greenRoute[0]));

            var redRoute = _searchStationService.FindKShortestPath("Toa Payoh", "Yishun", 3);
            var redLine  = new String[] { "Yishun", "Khatib", "Yio Chu Kang", "Ang Mo Kio", "Bishan", "Braddell", "Toa Payoh" };

            Assert.IsTrue(TestUtility.IsSameRoute(redLine, redRoute[0]));

            var purpleRoute = _searchStationService.FindKShortestPath("Sengkang", "Hougang", 3);
            var purpleLine  = new String[] { "Hougang", "Buangkok", "Sengkang" };

            Assert.IsTrue(TestUtility.IsSameRoute(purpleLine, purpleRoute[0]));
        }
Beispiel #2
0
        public void TestFormatRouteToRouteDTO_JooKoonToJurongEastSameLine()
        {
            var           greenRoute   = _searchStationService.FindKShortestPath("Joo Koon", "Jurong East", 3);
            var           instructions = _searchStationService.FormatRouteToRouteDTO(greenRoute[0]);
            List <string> expected     = new List <string> {
                "Take EW from Joo Koon to Pioneer",
                "Take EW from Pioneer to Boon Lay",
                "Take EW from Boon Lay to Lakeside",
                "Take EW from Lakeside to Chinese Garden",
                "Take EW from Chinese Garden to Jurong East"
            };

            Assert.AreEqual(instructions.Instructions, expected);
        }