Exemplo n.º 1
0
 public void WeakKeyDictionary_AddDuplicateEntry_EntryUpdated()
 {
     using (var key = new DisposableTestObject("dontDupMeBro"))
     {
         const int FortyTwo   = 42;
         var       dictionary = new WeakKeyDictionary <DisposableTestObject, int>();
         Assert.True(dictionary.AddEntry(key, FortyTwo));
         Assert.False(dictionary.AddEntry(key, FortyTwo + 1));
         Assert.True(dictionary.ContainsKey(key));
         Assert.Equal(FortyTwo + 1, dictionary.GetEntry(key));
     }
 }