public void AddsTrainPart()
        {
            TestDataFactory.Init();
            var train = TestDataFactory.CreateTrains("Persontåg", new Time(12, 00)).First();
            var part  = new TrainPart(train, 0, 1);

            Target.Add(part);
            Assert.AreEqual(part, Target.Parts.First());
        }
Exemple #2
0
        public void PropertiesAreSet()
        {
            TestDataFactory.Init();
            var station = TestDataFactory.Stations.First();
            var target  = new StationExit("Vänster");

            station.Add(target);
            Assert.AreEqual(station, target.Station);
            Assert.AreEqual("Vänster", target.Name);
        }
Exemple #3
0
        public void ReturnsPassings()
        {
            TestDataFactory.Init();
            var target = TestDataFactory.CreateTimetable();

            foreach (var stretch in target.Layout.TrackStretches)
            {
                Assert.AreEqual(2, stretch.Passings.Count());
            }
        }
Exemple #4
0
        [TestMethod] public void LoadsTestLayout()
        {
            TestDataFactory.Init();
            ILayoutRepository repository = new TestRepository();

            var(item, _) = repository.GetLayout("test");
            var layout = item.Value;

            Assert.AreEqual(3, layout.Stations.Count);
            Assert.AreEqual(layout.Station("G").Value.Stretches.First().End.Station, layout.Station("Yb").Value);
        }
Exemple #5
0
        public void LoadsTestTimetable()
        {
            TestDataFactory.Init();
            ITimetableReadStore repository = new TestRepository();

            var(item, _) = repository.GetTimetable("scenario1");
            var timetable = item.Value;

            Assert.AreEqual(2, timetable.Trains.Count);
            Assert.AreEqual(3, timetable.Stations.Count());
        }
        public void EqualsWorks()
        {
            TestDataFactory.Init();
            var station = TestDataFactory.CreateStation1();
            var train   = TestDataFactory.CreateTrain1();
            var one     = new StationCall(station.Tracks.First(), new Time(12, 00), new Time(12, 00))
            {
                Train = train
            };
            var another = new StationCall(station.Tracks.First(), new Time(12, 00), new Time(12, 00))
            {
                Train = train
            };

            Assert.AreEqual(one, another);
        }
 public void TestInitialize()
 {
     TestDataFactory.Init();
     Target = new TimetableStretch("10", "Ten");
 }
 public void TestInitialize()
 {
     TestDataFactory.Init();
     Train = TestDataFactory.CreateTrain1();
 }