Ejemplo n.º 1
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);

            }
        }
Ejemplo n.º 2
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));
 }
Ejemplo n.º 3
0
        public void LiveboardTest()
        {
            NMBS target = new NMBS();
            Random r = new Random();
            Station station = target.Stations().ElementAt(r.Next(target.Stations().Count));

            IList<Departure> actual;
            actual = target.Liveboard(station);
        }
Ejemplo n.º 4
0
        public void StationsTestInEveryLanguage()
        {
            int first_amount = 0;
            NMBS target = new NMBS(NMBSLanguage.DE);
            first_amount = target.Stations().Count;
            Assert.IsFalse( first_amount < 1, "No stations could be fetched");

            target = new NMBS(NMBSLanguage.EN);
            Assert.IsTrue(target.Stations().Count == first_amount, "EN list of stations behaves odd");
            target = new NMBS(NMBSLanguage.FR);
            Assert.IsTrue(target.Stations().Count == first_amount, "FR list of stations behaves odd");
            target = new NMBS(NMBSLanguage.NL);
            Assert.IsTrue(target.Stations().Count == first_amount, "NL list of stations behaves odd");
        }