public void IsReadable() { var empty = new EmptyByteBuffer(UnpooledByteBufferAllocator.Default); Assert.False(empty.IsReadable()); Assert.False(empty.IsReadable(1)); }
public void MemoryAddress() { var empty = new EmptyByteBuffer(UnpooledByteBufferAllocator.Default); Assert.False(empty.HasMemoryAddress); Assert.Throws <NotSupportedException>(() => empty.GetPinnableMemoryAddress()); }
public void Array() { var empty = new EmptyByteBuffer(UnpooledByteBufferAllocator.Default); Assert.True(empty.HasArray); Assert.Empty(empty.Array); Assert.Equal(0, empty.ArrayOffset); }
public unsafe void MemoryAddress() { var empty = new EmptyByteBuffer(UnpooledByteBufferAllocator.Default); Assert.False(empty.HasMemoryAddress); byte *address; Assert.Throws <NotSupportedException>(() => address = empty.MemoryAddress); }
public void WriteEmptyByteBuf() { var empty = new EmptyByteBuffer(UnpooledByteBufferAllocator.Default); empty.WriteBytes(Unpooled.Empty); // Ok IByteBuffer nonEmpty = UnpooledByteBufferAllocator.Default.Buffer().WriteBoolean(false); Assert.Throws <IndexOutOfRangeException>(() => empty.WriteBytes(nonEmpty)); nonEmpty.Release(); }
public void GetCharSequence() { var empty = new EmptyByteBuffer(UnpooledByteBufferAllocator.Default); Assert.Equal("", empty.ReadCharSequence(0, System.Text.Encoding.ASCII)); }
public void IsContiguous() { var empty = new EmptyByteBuffer(UnpooledByteBufferAllocator.Default); Assert.True(empty.IsContiguous); }