Пример #1
0
        public async Task Test_set_data_on_redis()
        {
            starshipService.SetAllOnRedis();

            var starships = await this.calculatorService.ResupplyCalculationFromCache(1000000);

            bool result = starships.Count > 0 ? true : false;

            Assert.IsTrue(result);

            redisService.ClearData();
        }
Пример #2
0
        public ActionResult <string> ClearData()
        {
            try
            {
                redisService.ClearData();
            }
            catch (System.Exception e)
            {
                throw e;
            }

            return("`{Redis is empty!}");
        }
Пример #3
0
        public async Task Test_runner_full_integration()
        {
            long       distance = 1000000;
            const long expected = 9;

            starshipService.SetAllOnRedis();
            var starships = await this.calculatorService.ResupplyCalculationFromCache(distance);

            var millenium = starships.FirstOrDefault(x => x.Name == "Millennium Falcon");

            bool result = millenium != null ? millenium.ResupplyFrequency == 9 ? true : false : false;

            Assert.AreEqual(millenium.ResupplyFrequency, expected);

            Assert.IsTrue(result);

            redisService.ClearData();
        }