예제 #1
0
        public void GetMemory_ShouldThrow_WhenDisposed()
        {
            var buffer      = new byte[1];
            var simpleOwner = new FakePoolOwner <byte>(buffer, 1);

            simpleOwner.Dispose();
            Assert.Throws <ObjectDisposedException>(() => simpleOwner.Memory);
        }
예제 #2
0
        public void Dispose_ShouldCallReturnToPool()
        {
            var buffer      = new byte[1];
            var simpleOwner = new FakePoolOwner <byte>(buffer, 1);

            simpleOwner.Dispose();
            simpleOwner.VerifyReturnToPool();
        }
예제 #3
0
 public void Ctor_ShouldRun_WhenLengthIsLesserOrEqualThanBufferLen()
 {
     var buffer = new byte[1];
     var owner  = new FakePoolOwner <byte>(buffer, 1);
 }