public void Contains() { var collection = new InstanceCollectionInt32 <Instance>(); var instance = new Instance(); int id = collection.Add(instance); Assert.IsTrue(collection.Contains(id), "collection.Contains(id)"); collection.Remove(id); Assert.IsFalse(collection.Contains(id), "collection.Contains(id)"); }
public void TryGetInstance() { var collection = new InstanceCollectionInt32 <Instance>(); var instance = new Instance(); int id = collection.Add(instance); collection.TryGetInstance(id, out var result); Assert.NotNull(result); Assert.AreEqual(result, instance); collection.Remove(id); collection.TryGetInstance(id, out result); Assert.Null(result); }