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(); }
public ActionResult <string> ClearData() { try { redisService.ClearData(); } catch (System.Exception e) { throw e; } return("`{Redis is empty!}"); }
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(); }