public void SetAndGetValue() { CachHelper.SetInCach(_person, _key); var newPerson = CachHelper.GetFromCach <Person>(_key); Assert.AreEqual(_person.Age, newPerson.Age); Assert.AreEqual(_person.Name, newPerson.Name); }
public async Task SetAndEndLifeTime() { CachHelper.SetInCach(_person, _key); //The lifetime is set to 2 seconds. await Task.Delay(new TimeSpan(0, 0, 3)); var newPerson = CachHelper.GetFromCach <Person>(_key); Assert.IsNull(newPerson); }