Пример #1
0
 public void TestAnotherPut()
 {
     _stagingArea.Put(_cacheKey, _secondEncodedImage);
     Assert.AreEqual(2, _closeableReference.GetUnderlyingReferenceTestOnly().GetRefCountTestOnly());
     Assert.AreSame(
         _closeableReference2.GetUnderlyingReferenceTestOnly(),
         _stagingArea.Get(_cacheKey).GetByteBufferRef().GetUnderlyingReferenceTestOnly());
 }
Пример #2
0
        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);
        }