Пример #1
0
        public void TestProviderNameVoi()
        {
            FetchVoiData      tier          = new FetchVoiData();
            FormattingDataVoi formattingVoi = new FormattingDataVoi();
            var fetchVoiTask = tier.FetchVoiDataMethod();
            var scooters     = formattingVoi.CreateVoiScooters(fetchVoiTask.Result);

            Assert.AreEqual("Voi", scooters[0].ProviderName);
        }
Пример #2
0
        public static async Task <Action <List <Scooter> > > FetchScooter()
        {
            while (true)
            {
                // FLASH:
                FetchFlashData     flash           = new FetchFlashData();
                FormatingDataFlash formattingFlash = new FormatingDataFlash();
                var fetchFlashTask = flash.FetchFlashDataMethod();

                // VOI:
                FetchVoiData      voi           = new FetchVoiData();
                FormattingDataVoi formattingVoi = new FormattingDataVoi();
                var fetchVoiTask = voi.FetchVoiDataMethod();

                // TIER:
                FetchTierData      tier           = new FetchTierData();
                FormattingDataTier formattingTier = new FormattingDataTier();
                var fetchTierTask = tier.FetchTierDataMethod();

                // ZVIPP:
                //FetchZvippData zvipp = new FetchZvippData();
                //FormattingDataZvipp formattingZvipp = new FormattingDataZvipp();
                //var fetchZvippTask = zvipp.FetchZvippDataMethod();

                // Running paralell fetch
                var allFlashScooters = formattingFlash.CreateFlashScooters(await fetchFlashTask);
                var allVoiScooters   = formattingVoi.CreateVoiScooters(await fetchVoiTask);
                var allTierScooters  = formattingTier.CreateTierScooters(await fetchTierTask);
                // var allZvippScooters = formattingZvipp.CreateZvippScooters(await fetchZvippTask);

                //.Concat(allZvippScooters)

                // Concating all lists to one list

                Scooters = allFlashScooters.Concat(allTierScooters).Concat(allVoiScooters).ToList();
                Console.WriteLine("done fetching scooters");
                System.Threading.Thread.Sleep(900000);
            }
        }