コード例 #1
0
 public void TryRemove_not_existing_returns_false()
 {
     using (var timedDictionary = new TimedDictionary <string, object>())
     {
         Assert.IsFalse(timedDictionary.TryRemove("test"));
     }
 }
コード例 #2
0
        public void Indexer_TryRemove_TryGetValue()
        {
            using (var timedDictionary = new TimedDictionary <string, object>())
            {
                timedDictionary["test"] = 1;

                Assert.IsTrue(timedDictionary.TryRemove("test"));

                object value;
                Assert.IsFalse(timedDictionary.TryGetValue("test", out value));
            }
        }