コード例 #1
0
ファイル: NMBSTest.cs プロジェクト: yvanj/NetRail
        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);

            }
        }
コード例 #2
0
ファイル: NMBSTest.cs プロジェクト: yvanj/NetRail
 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));
 }
コード例 #3
0
ファイル: NMBSTest.cs プロジェクト: yvanj/NetRail
        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);
        }
コード例 #4
0
ファイル: NMBSTest.cs プロジェクト: yvanj/NetRail
        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");
        }