Esempio n. 1
0
 public void ConnectionsTest1()
 {
     NMBS target = new NMBS();
     Random r = new Random();
     Station fromStation = target.Stations().ElementAt(r.Next(target.Stations().Count));
     Station destinationStation = target.Stations().ElementAt(r.Next(target.Stations().Count));
     NMBSTimeSelection timeType = NMBSTimeSelection.DepartureTime;
     DateTime moment = DateTime.Now.AddDays(1);
     IList<Connection> actual;
     actual = target.Connections(fromStation, destinationStation, timeType, moment);
     Assert.IsTrue(actual.Count > 0,String.Format("Departing at {0} from {1} to {2} failed.", moment, fromStation.Name, destinationStation.Name));
     timeType = NMBSTimeSelection.DepartureTime;
     actual = target.Connections(fromStation, destinationStation, timeType, moment);
     Assert.IsTrue(actual.Count > 0, String.Format( "Arriving at {0} from {1} to {2} failed.", moment, fromStation.Name, destinationStation.Name));
 }
Esempio n. 2
0
        public void ConnectionsTest()
        {
            NMBS target = new NMBS();
            Random r = new Random();

            for (int i = 0; i < 4; i++)
            {
                Station fromStation = target.Stations().ElementAt(r.Next(target.Stations().Count));
                Station destinationStation = target.Stations().ElementAt(r.Next(target.Stations().Count));
                IList<Connection> actual;
                actual = target.Connections(fromStation, destinationStation);

            }
        }