Exemplo n.º 1
0
        public void CompleteAdding_AddAsyncCalled_ThrowsInvalidOperationException()
        {
            var buffer = new ChunksBuffer();

            buffer.CompleteAdding();

            Assert.Throws <InvalidOperationException>(() => buffer.Add(new byte[] {}));
        }
Exemplo n.º 2
0
        public void CompleteAdding_TakeAsyncCalled_ThrowsInvalidOperationException()
        {
            var buffer = new ChunksBuffer();

            buffer.CompleteAdding();

            Assert.ThrowsAsync <InvalidOperationException>(async() => await buffer.TakeAsync(1));
        }