Пример #1
0
        public void AppendFill_Should_Throw_On_Non_Positive_Count(int count)
        {
            var buffer = new BoundedBuffer();

            buffer.Invoking(b => b.AppendFill(Helpers.EmptyBuffer, 0, count))
            .ShouldThrow <ArgumentOutOfRangeException>();
        }
Пример #2
0
        public void AppendFill_Should_Throw_On_Bad_Segment_Length()
        {
            var buffer = new BoundedBuffer();

            buffer.Invoking(b => b.AppendFill(Helpers.EmptyBuffer, 0, 1))
            .ShouldThrow <ArraySegmentException>();
        }
Пример #3
0
        public void AppendFill_Should_Throw_On_Negative_Offset()
        {
            var buffer = new BoundedBuffer();

            buffer.Invoking(b => b.AppendFill(Helpers.EmptyBuffer, -1, 0))
            .ShouldThrow <ArgumentOutOfRangeException>();
        }
Пример #4
0
        public void AppendFill_Should_Throw_On_Null_Buffer()
        {
            var buffer = new BoundedBuffer();

            buffer.Invoking(b => b.AppendFill(null, 0, 0))
            .ShouldThrow <ArgumentNullException>();
        }
Пример #5
0
        public void ExtractAndReset_With_Zero_Capacity_Should_Not_Throw()
        {
            var buffer = new BoundedBuffer(32);

            buffer.Invoking(b => b.ExtractAndReset(0))
            .ShouldNotThrow();
        }
Пример #6
0
        public void AppendFill_Should_Throw_After_Disposal()
        {
            var buffer = new BoundedBuffer(32);

            buffer.Dispose();

            buffer.Invoking(b => b.AppendFill(Helpers.EmptyBuffer, 0, 0))
            .ShouldThrow <ObjectDisposedException>();
        }
Пример #7
0
        public void Reset_Should_Throw_After_Disposal()
        {
            var buffer = new BoundedBuffer(32);

            buffer.Dispose();

            buffer.Invoking(b => b.Reset(0))
            .ShouldThrow <ObjectDisposedException>();
        }
Пример #8
0
        public void FreeSpace_Access_Should_Throw_After_Disposal()
        {
            var buffer = new BoundedBuffer(32);

            buffer.Dispose();

            buffer.Invoking(b => b.FreeSpace.Whatever())
            .ShouldThrow <ObjectDisposedException>();
        }
Пример #9
0
        public void Double_Dispose_Should_Not_Throw()
        {
            var buffer = new BoundedBuffer(32);

            buffer.Dispose();

            buffer.Invoking(b => b.Dispose())
            .ShouldNotThrow();
        }
Пример #10
0
 public void Reset_With_Zero_Capacity_Should_Not_Throw()
 {
     var buffer = new BoundedBuffer(32);
     buffer.Invoking(b => b.Reset(0))
           .ShouldNotThrow();
 }
Пример #11
0
        public void Reset_Should_Throw_On_Negative_Capacity()
        {
            var buffer = new BoundedBuffer(32);

            buffer.Invoking(b => b.Reset(-1))
                  .ShouldThrow<ArgumentOutOfRangeException>();
        }
Пример #12
0
        public void Reset_Should_Throw_After_Disposal()
        {
            var buffer = new BoundedBuffer(32);
            buffer.Dispose();

            buffer.Invoking(b => b.Reset(0))
                  .ShouldThrow<ObjectDisposedException>();
        }
Пример #13
0
        public void FreeSpace_Access_Should_Throw_After_Disposal()
        {
            var buffer = new BoundedBuffer(32);
            buffer.Dispose();

            buffer.Invoking(b => b.FreeSpace.Whatever())
                  .ShouldThrow<ObjectDisposedException>();
        }
Пример #14
0
        public void Double_Dispose_Should_Not_Throw()
        {
            var buffer = new BoundedBuffer(32);
            buffer.Dispose();

            buffer.Invoking(b => b.Dispose())
                  .ShouldNotThrow();
        }
Пример #15
0
        public void AppendFill_Should_Throw_On_Null_Buffer()
        {
            var buffer = new BoundedBuffer();

            buffer.Invoking(b => b.AppendFill(null, 0, 0))
                  .ShouldThrow<ArgumentNullException>();
        }
Пример #16
0
 public void AppendFill_Should_Throw_On_Non_Positive_Count(int count)
 {
     var buffer = new BoundedBuffer();
     buffer.Invoking(b => b.AppendFill(Helpers.EmptyBuffer, 0, count))
           .ShouldThrow<ArgumentOutOfRangeException>();
 }
Пример #17
0
        public void AppendFill_Should_Throw_After_Disposal()
        {
            var buffer = new BoundedBuffer(32);
            buffer.Dispose();

            buffer.Invoking(b => b.AppendFill(Helpers.EmptyBuffer, 0, 0))
                  .ShouldThrow<ObjectDisposedException>();
        }
Пример #18
0
 public void AppendFill_Should_Throw_On_Bad_Segment_Length()
 {
     var buffer = new BoundedBuffer();
     buffer.Invoking(b => b.AppendFill(Helpers.EmptyBuffer, 0, 1))
           .ShouldThrow<ArraySegmentException>();
 }
Пример #19
0
        public void AppendFill_Should_Throw_On_Negative_Offset()
        {
            var buffer = new BoundedBuffer();

            buffer.Invoking(b => b.AppendFill(Helpers.EmptyBuffer, -1, 0))
                  .ShouldThrow<ArgumentOutOfRangeException>();
        }