public void SetAndGetValueCustomSerealize()
        {
            CachHelper.SetInCachWithCustomSerilizable(_person, _key);
            var newPerson = CachHelper.GetFromCachWithCustomSerilizable <Person>(_key);

            Assert.AreEqual(_person.Age, newPerson.Age);
            Assert.AreEqual(_person.Name, newPerson.Name);
        }
        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 SetAndEndLifeTimeCustomSerealize()
        {
            CachHelper.SetInCachWithCustomSerilizable(_person, _key);

            //The lifetime is set to 2 seconds.
            await Task.Delay(new TimeSpan(0, 0, 3));

            var newPerson = CachHelper.GetFromCachWithCustomSerilizable <Person>(_key);

            Assert.IsNull(newPerson);
        }