public void EntityIsReleased() { _defaultEntity.Retain(this); _defaultEntity.Release(this); Assert.AreEqual(0, _defaultEntity.RetainCount); if (_defaultEntity.AERC is SafeAERC safeAerc) { Assert.IsFalse(safeAerc.Owners.Contains(this)); } }
public void EntityCannotBeReleasedWithWrongOwner() { var owner = new object(); Assert.Throws <EntityIsNotRetainedByOwnerException>(() => _entity.Release(owner)); }