예제 #1
0
        public void CheckSortRoute_CheckEmpty_ExpectOk()
        {
            var composer = new RouteComposer();
            var routes   = composer.SortRoute(new Route[0]);

            Assert.AreEqual(Enumerable.Empty <Route>(), routes);
        }
예제 #2
0
        public void CheckParseRoute_CheckParseMultiple_ExpectOk()
        {
            var composer = new RouteComposer();
            var routes   = composer.ParseRoute(new[] { "Мельбурн → Кельн", "Москва → Париж", "Кельн → Москва" });

            Assert.AreEqual("Мельбурн → Кельн, Москва → Париж, Кельн → Москва", string.Join(", ", routes.Select(r => r.ToString())));
        }
예제 #3
0
        public void CheckParseRoute_CheckParseOne_ExpectOk()
        {
            var composer = new RouteComposer();
            var routes   = composer.ParseRoute(new [] { "Мельбурн → Кельн" });

            Assert.AreEqual("Мельбурн → Кельн", routes.First().ToString());
        }
예제 #4
0
        public void CheckParseRoute_CheckNull_ExpectOk()
        {
            var composer = new RouteComposer();
            var routes   = composer.ParseRoute(null);

            Assert.AreEqual(Enumerable.Empty <Route>(), routes);
        }
예제 #5
0
        public void CheckSortRoute_CheckOne_ExpectOk()
        {
            var composer = new RouteComposer();
            var routes   = composer.SortRoute(new [] { new Route {
                                                           From = "Мельбурн", To = "Кельн"
                                                       } });

            Assert.AreEqual("Мельбурн → Кельн", routes.First().ToString());
        }
예제 #6
0
        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())));
        }
예제 #7
0
        public void CheckParseRoute_CheckParseFromOnly_ExpectError()
        {
            var composer = new RouteComposer();

            composer.ParseRoute(new[] { "→ Кельн" }).First();
        }
예제 #8
0
        public void CheckParseRoute_CheckParseWrong_ExpectError()
        {
            var composer = new RouteComposer();

            composer.ParseRoute(new[] { "Мельбурн Кельн" }).First();
        }