public void CheckSortRoute_CheckEmpty_ExpectOk() { var composer = new RouteComposer(); var routes = composer.SortRoute(new Route[0]); Assert.AreEqual(Enumerable.Empty <Route>(), routes); }
public void CheckParseRoute_CheckParseMultiple_ExpectOk() { var composer = new RouteComposer(); var routes = composer.ParseRoute(new[] { "Мельбурн → Кельн", "Москва → Париж", "Кельн → Москва" }); Assert.AreEqual("Мельбурн → Кельн, Москва → Париж, Кельн → Москва", string.Join(", ", routes.Select(r => r.ToString()))); }
public void CheckParseRoute_CheckParseOne_ExpectOk() { var composer = new RouteComposer(); var routes = composer.ParseRoute(new [] { "Мельбурн → Кельн" }); Assert.AreEqual("Мельбурн → Кельн", routes.First().ToString()); }
public void CheckParseRoute_CheckNull_ExpectOk() { var composer = new RouteComposer(); var routes = composer.ParseRoute(null); Assert.AreEqual(Enumerable.Empty <Route>(), routes); }
public void CheckSortRoute_CheckOne_ExpectOk() { var composer = new RouteComposer(); var routes = composer.SortRoute(new [] { new Route { From = "Мельбурн", To = "Кельн" } }); Assert.AreEqual("Мельбурн → Кельн", routes.First().ToString()); }
public void CheckSortRoute_CheckTwoReverse_ExpectOk() { var composer = new RouteComposer(); var routes = composer.SortRoute(new[] { new Route { From = "Кельн", To = "Москва" }, new Route { From = "Мельбурн", To = "Кельн" } }); Assert.AreEqual("Мельбурн → Кельн, Кельн → Москва", string.Join(", ", routes.Select(r => r.ToString()))); }
public void CheckParseRoute_CheckParseFromOnly_ExpectError() { var composer = new RouteComposer(); composer.ParseRoute(new[] { "→ Кельн" }).First(); }
public void CheckParseRoute_CheckParseWrong_ExpectError() { var composer = new RouteComposer(); composer.ParseRoute(new[] { "Мельбурн Кельн" }).First(); }