Esempio n. 1
0
        public void TestProviderNameTier()
        {
            FetchTierData      tier           = new FetchTierData();
            FormattingDataTier formattingTier = new FormattingDataTier();
            var fetchTierTask = tier.FetchTierDataMethod();
            var scooters      = formattingTier.CreateTierScooters(fetchTierTask.Result);

            Assert.AreEqual("Tier", scooters[0].ProviderName);
        }
Esempio n. 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);
            }
        }