示例#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();
        }