Пример #1
0
        public async void ShouldIgnoreAdditionalInfoAtDepartureTime()
        {
            var testData = @"{""d"":{""__type"":""Ideo.BusinessLogic.PointData"",""LineName"":""163"",""StopName"":""Rżąka"",""Route"":""Rżąka - Czerwiakowskiego, Wielicka, Teligi, Ćwiklińskiej, Bieżanowska, Agatowa, Półłanki, Klasztorna, Al. Jana Pawła II, Al. Solidarności, Al. Przyjaźni - Aleja Przyjaźni"",""Description"":""K - Kurs do przystanku Kombinat\n"",""ValidFrom"":""25.02.2017"",""PointTime"":{""03"":{""5"":[""06K"",""36""],""6"":[""36""],""7"":[""36""],""8"":[""19"",""59""],""9"":[""39""],""10"":[""19"",""59""],""11"":[""39""],""12"":[""19"",""59""],""13"":[""39""],""14"":[""19"",""59""],""15"":[""39""],""16"":[""19"",""59""],""17"":[""39""],""18"":[""19"",""59""],""19"":[""55""],""20"":[""49""],""21"":[""49""],""22"":[""49""]}}}}";

            var apiClientMock = new Mock <IMpkApiClient>();

            apiClientMock.Setup(client => client.GetPointData(It.IsAny <JObject>())).Returns(async() => testData);
            var shedulesDownloader = new ShedulesDownloader(apiClientMock.Object);

            var shedules = await shedulesDownloader.DownloadShedule(2, "asd");

            Assert.Equal(DateTime.Today.AddHours(5).AddMinutes(6), shedules.Departures.First());
        }
Пример #2
0
 public SchedulesDownloaderTests()
 {
     _shedulesDownloader = new ShedulesDownloader(new MpkApiClientStub());
 }