Пример #1
0
        public void TestGetSigment()
        {
            FlightPlan           plan;
            Location             location = new Location(34.0, 32.2, DateTime.Now);
            double               lat = 34.2, lon = 32.4;
            int                  time     = 500;
            LinkedList <Segment> segments = new LinkedList <Segment>();

            for (var i = 0; i < 10; i++)
            {
                Segment seg = new Segment(lat, lon, time);
                lat += 0.2;
                lon += 0.2;
                segments.AddLast(seg);
            }

            plan = new FlightPlan(100, "wizzair", location, segments);

            int actual;
            int expected = 2;

            actual = plan.FindSegment(DateTime.Now.AddSeconds(1200));
            Assert.AreEqual(actual, expected);
        }