public void TestAnotherPut() { _stagingArea.Put(_cacheKey, _secondEncodedImage); Assert.AreEqual(2, _closeableReference.GetUnderlyingReferenceTestOnly().GetRefCountTestOnly()); Assert.AreSame( _closeableReference2.GetUnderlyingReferenceTestOnly(), _stagingArea.Get(_cacheKey).GetByteBufferRef().GetUnderlyingReferenceTestOnly()); }
public void Initialize() { _stagingArea = StagingArea.Instance; _closeableReference = CloseableReference <IPooledByteBuffer> .of(new TrivialPooledByteBuffer(BYTES)); _closeableReference2 = CloseableReference <IPooledByteBuffer> .of(new TrivialPooledByteBuffer(BYTES)); _encodedImage = new EncodedImage(_closeableReference); _secondEncodedImage = new EncodedImage(_closeableReference2); _cacheKey = new SimpleCacheKey("http://this.is/uri"); _stagingArea.Put(_cacheKey, _encodedImage); }