ChangeTo() public method

public ChangeTo ( int value ) : void
value int
return void
 public void ItemShouldBeRemovedAtTheExpirationOfStandardPeriod()
 {
     var myDatabase = new SlowDatabase();
     var alphaMachine = new TheTimeMachine();
     IDataStorage<int, string> myRefreshingCache = new FastRefreshingCache<int, string>(alphaMachine, myDatabase);
     myRefreshingCache.GetValue(0);
     alphaMachine.ChangeTo(1500);
     myRefreshingCache.GetValue(5);
     var zero = myRefreshingCache.Contains(0);
     var five = myRefreshingCache.Contains(5);
     Assert.AreEqual(true, !zero && five);
 }
示例#2
0
        public void ItemShouldBeRemovedAtTheExpirationOfStandardPeriod()
        {
            var myDatabase   = new SlowDatabase();
            var alphaMachine = new TheTimeMachine();
            IDataStorage <int, string> myRefreshingCache = new FastRefreshingCache <int, string>(alphaMachine, myDatabase);

            myRefreshingCache.GetValue(0);
            alphaMachine.ChangeTo(1500);
            myRefreshingCache.GetValue(5);
            var zero = myRefreshingCache.Contains(0);
            var five = myRefreshingCache.Contains(5);

            Assert.AreEqual(true, !zero && five);
        }