public void TestRouteDictionary() { BusRouteGuider.View.SearchRoute alg = new BusRouteGuider.View.SearchRoute(); String routeIn = "Fort,Kiribathgoda,Miriswatha,Nittambuwa,Warakapola,Nelundeniya,Galigamuwa,Kegalle,Mawanella,Kadugannawa,Peradeniya,Kandy"; String routeOut = "Kandy,Peradeniya,Kadugannawa,Mawanella,Kegalle,Galigamuwa,Nelundeniya,Warakapola,Nittambuwa,Miriswatha,Kiribathgoda,Fort"; String expectedRoute = "Fort->Kiribathgoda->Miriswatha->Nittambuwa->Warakapola->Nelundeniya->Galigamuwa->Kegalle->Mawanella->Kadugannawa->Peradeniya->Kandy"; String routeNumber = "001"; BusRouteGuider.View.Route route = new BusRouteGuider.View.Route(routeNumber); route = alg.processInput(routeIn, route); route = alg.processInput(routeOut, route); Assert.AreEqual(route.getPath(), expectedRoute); }
public void TestRouteDictionary() { BusRouteGuider.View.SearchRoute alg = new BusRouteGuider.View.SearchRoute(); String routeIn = "Fort,Kiribathgoda,Miriswatha,Nittambuwa,Warakapola,Nelundeniya,Galigamuwa,Kegalle,Mawanella,Kadugannawa,Peradeniya,Kandy"; String routeOut = "Kandy,Peradeniya,Kadugannawa,Mawanella,Kegalle,Galigamuwa,Nelundeniya,Warakapola,Nittambuwa,Miriswatha,Kiribathgoda,Fort"; String expectedRoute = "Fort->Kiribathgoda->Miriswatha->Nittambuwa->Warakapola->Nelundeniya->Galigamuwa->Kegalle->Mawanella->Kadugannawa->Peradeniya->Kandy"; String routeNumber = "001"; BusRouteGuider.View.Route route = new BusRouteGuider.View.Route(routeNumber); route = alg.processInput(routeIn, route); route = alg.processInput(routeOut, route); Assert.AreEqual(route.getPath(), expectedRoute); }