public void It_returns_null_for_a_non_existing_object() { var objectId = ObjectId.NewUniqueId(); var map = new ObjectIdentityMap(); var nonExisting = map.GetById(objectId); Assert.IsNull(nonExisting); }
public void It_returns_object_by_its_id() { var objectId = ObjectId.NewUniqueId(); var o = new object(); var map = new ObjectIdentityMap(); map.Put(objectId, o); var existing = map.GetById(objectId); Assert.AreSame(o, existing); }