Esempio n. 1
0
        public void GetDistance_RouteABC_9IsReturned()
        {
            // Arrange
            var routePlanner = new RoutePlannerBL(new Graph <Academy>());

            routePlanner.AddRoute(academyA, academyB, 5);
            routePlanner.AddRoute(academyB, academyC, 4);
            var routeQuery = new List <Academy>()
            {
                academyA, academyB, academyC
            };

            // Action
            var distance = routePlanner.GetDistance(routeQuery);

            // Assert
            Assert.AreEqual(9, distance);
        }
Esempio n. 2
0
        private RoutePlannerBL DefaultPlanerSetup()
        {
            var routePlanner = new RoutePlannerBL(new Graph <Academy>());

            routePlanner.AddRoute(academyA, academyB, 5);
            routePlanner.AddRoute(academyB, academyC, 4);
            routePlanner.AddRoute(academyC, academyD, 8);
            routePlanner.AddRoute(academyD, academyC, 8);
            routePlanner.AddRoute(academyD, academyE, 6);
            routePlanner.AddRoute(academyA, academyD, 5);
            routePlanner.AddRoute(academyC, academyE, 2);
            routePlanner.AddRoute(academyE, academyB, 3);
            routePlanner.AddRoute(academyA, academyE, 7);

            return(routePlanner);
        }