示例#1
0
        public void Translate_Journey_CorrectTranslation()
        {
            const ulong time         = 15761461220ul;
            const ulong previousTime = 15761454920ul;



            var tdb = new TransitDb(0);
            var wr  = tdb.GetWriter();
            var l   = wr.AddOrUpdateStop("Some Station", 4.123, 51.789, null);

            var rootL      = new StopId(1, 140860940, 184354050); // Supposed to be an OSM-location
            var connection = new Connection(new ConnectionId(0, 1),
                                            "testConnection", rootL, l, previousTime, (ushort)(time - previousTime), new TripId(0, 0));

            var connId = wr.AddOrUpdateConnection(connection);

            wr.Close();
            var genesis = new Journey <TransferMetric>(rootL, previousTime, TransferMetric.Factory);
            var j       = genesis.ChainSpecial(connId, previousTime, l, new TripId(3, 3));

            var op        = new Operator("Op", tdb, null, 500, new string[] { }, new string[] { });
            var operators = new OperatorSet(new List <Operator> {
                op
            });
            var translatedSegment =
                operators.TranslateWalkSegment(j, new CoordinatesCache(new DummyOtherMode(), false));

            Assert.Contains("openstreetmap.org", translatedSegment.Departure.Location.Id);
            Assert.DoesNotContain("openstreetmap.org", translatedSegment.Arrival.Location.Id);
        }