public void Dispose_can_be_called_more_than_once()
        {
            var baseSource = Substitute.For <IBsonChunkSource>();
            var subject    = new OutputBufferChunkSource(baseSource);

            subject.Dispose();
            subject.Dispose();
        }
Esempio n. 2
0
        public void Dispose_can_be_called_more_than_once()
        {
            var mockBaseSource = new Mock <IBsonChunkSource>();
            var subject        = new OutputBufferChunkSource(mockBaseSource.Object);

            subject.Dispose();
            subject.Dispose();
        }
        public void BaseSource_get_should_throw_when_subject_is_disposed()
        {
            var baseSource = Substitute.For <IBsonChunkSource>();
            var subject    = new OutputBufferChunkSource(baseSource);

            subject.Dispose();

            Action action = () => { var _ = subject.BaseSource; };

            action.ShouldThrow <ObjectDisposedException>().And.ObjectName.Should().Be("OutputBufferChunkSource");
        }
        public void Dispose_should_dispose_subject()
        {
            var baseSource = Substitute.For <IBsonChunkSource>();
            var subject    = new OutputBufferChunkSource(baseSource);

            subject.Dispose();

            var reflector = new Reflector(subject);

            reflector._disposed.Should().BeTrue();
        }
Esempio n. 5
0
        public void GetChunk_should_throw_when_subject_is_disposed()
        {
            var mockBaseSource = new Mock <IBsonChunkSource>();
            var subject        = new OutputBufferChunkSource(mockBaseSource.Object);

            subject.Dispose();

            Action action = () => subject.GetChunk(1);

            action.ShouldThrow <ObjectDisposedException>().And.ObjectName.Should().Be("OutputBufferChunkSource");
        }
Esempio n. 6
0
        public void Dispose_should_dispose_subject()
        {
            var mockBaseSource = new Mock <IBsonChunkSource>();
            var subject        = new OutputBufferChunkSource(mockBaseSource.Object);

            subject.Dispose();

            var reflector = new Reflector(subject);

            reflector._disposed.Should().BeTrue();
        }