Example #1
0
        public void SimpleTest()
        {
            var travel = new[]
            {
                new AirportItinerary.Route {
                    In = "TRN", Out = "FCO"
                }
            };

            Assert.AreEqual("TRN-FCO", AirportItinerary.Itinerary(travel));
        }
Example #2
0
        public void SameAirportsAreSkippedTest()
        {
            var travel = new[]
            {
                new AirportItinerary.Route {
                    In = "TRN", Out = "FCO"
                },
                new AirportItinerary.Route {
                    In = "FCO", Out = "JFK"
                }
            };

            Assert.AreEqual("TRN-FCO-JFK", AirportItinerary.Itinerary(travel));
        }
Example #3
0
        public void RoundTripAreConservedWithSharedAirportsTest()
        {
            var travel = new[]
            {
                new AirportItinerary.Route {
                    In = "TRN", Out = "FCO"
                },
                new AirportItinerary.Route {
                    In = "FCO", Out = "TRN"
                }
            };

            Assert.AreEqual("TRN-FCO-TRN", AirportItinerary.Itinerary(travel));
        }
Example #4
0
        public void MultipleTest()
        {
            var travel = new[]
            {
                new AirportItinerary.Route {
                    In = "TRN", Out = "FCO"
                },
                new AirportItinerary.Route {
                    In = "CIA", Out = "JFK"
                }
            };

            Assert.AreEqual("TRN-FCO-CIA-JFK", AirportItinerary.Itinerary(travel));
        }