public void LinearJtg3WriteTest()
        {
            var versions = new[] { TimetableVersion.JTG3_0, TimetableVersion.JTG3_1 };

            foreach (var version in versions)
            {
                var tt = new Timetable(TimetableType.Linear);
                tt.SetVersion(version);
                var s = new Station(tt);

                var pos = new PositionCollection(s, tt);
                pos.SetPosition(Timetable.LINEAR_ROUTE_ID, 123.4f);
                pos.Write();

                Assert.AreEqual("123.4", s.Attributes["kml"]);
                Assert.AreEqual("123.4", s.Attributes["kmr"]);

                // Other write does not affect data
                pos.SetPosition(1, 0f);
                pos.Write();

                Assert.AreEqual("123.4", s.Attributes["kml"]);
                Assert.AreEqual("123.4", s.Attributes["kmr"]);

                // Linear/Jtg3 has no km
                Assert.AreEqual(false, s.Attributes.ContainsKey("km"));
            }
        }
        public void NetworkWriteTest()
        {
            var tt = new Timetable(TimetableType.Network);
            var s  = new Station(tt);

            var pos = new PositionCollection(s, tt);

            pos.TestForErrors(); // Should do nothing
            pos.SetPosition(123, 11.3f);
            Assert.AreEqual(11.3f, pos.GetPosition(123));
            pos.Write();
            pos.TestForErrors(); // Should do nothing
            Assert.AreEqual("123:11.3", s.Attributes["km"]);

            pos.SetPosition(222, 0f);
            pos.Write();
            Assert.AreEqual("123:11.3;222:0.0", s.Attributes["km"]);

            // Network has no right/left
            Assert.AreEqual(false, s.Attributes.ContainsKey("kml"));
            Assert.AreEqual(false, s.Attributes.ContainsKey("kmr"));
        }