public static void TestOrderedGuidCache_TryRemove_DoesntRemoveUnknown() { var cache = new OrderedGuidCache(); cache.TryAdd(Guid.NewGuid(), 0); Assert.False(cache.TryRemove(Guid.NewGuid())); Assert.AreEqual(1, cache.Count); }
public static void TestOrderedGuidCache_Contains_DoesntFindRemovedItem() { var cache = new OrderedGuidCache(); var guid = Guid.NewGuid(); cache.TryAdd(Guid.NewGuid(), 1); cache.TryAdd(guid, 2); cache.TryAdd(Guid.NewGuid(), 3); cache.TryRemove(guid); Assert.False(cache.Contains(guid)); }
public static void TestOrderedGuidCache_TryRemove_DoesRemoveKnown() { var cache = new OrderedGuidCache(); var guid = Guid.NewGuid(); cache.TryAdd(Guid.NewGuid(), 1); cache.TryAdd(guid, 2); cache.TryAdd(Guid.NewGuid(), 3); Assert.True(cache.TryRemove(guid)); Assert.AreEqual(2, cache.Count); Assert.False(cache.Contains(guid)); }