public void SetToCacheAndGetFromCache_Pizza_Test() { var cachingService = new CachingService(); var pizza = new Pizza() { Title = "Pepperoni" }; cachingService.SetToCache("PepperoniPizza", pizza); var pizzaFromCache = cachingService.GetFromCache <Pizza>("PepperoniPizza"); Assert.AreEqual(pizza.Title, pizzaFromCache.Title); }
public void SetToCacheAndGetFromCache_Null_Test() { var cachingService = new CachingService(); var pizza = new Pizza() { Title = "Pepperoni" }; cachingService.SetToCache("PepperoniPizza", pizza); Thread.Sleep(1000); var pizzaFromCache = cachingService.GetFromCache <Pizza>("PepperoniPizza"); Assert.IsNull(pizzaFromCache); }