示例#1
0
        public void Disposed_can_be_called_more_than_once()
        {
            var subject = new ByteArrayChunk(1);

            subject.Dispose();
            subject.Dispose();
        }
示例#2
0
        public void Bytes_get_should_throw_when_subject_is_disposed()
        {
            var subject = new ByteArrayChunk(1);

            subject.Dispose();

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

            action.ShouldThrow <ObjectDisposedException>().And.ObjectName.Should().Be("ByteArrayChunk");
        }
示例#3
0
        public void Dispose_should_dispose_subject()
        {
            var subject = new ByteArrayChunk(1);

            subject.Dispose();

            var reflector = new Reflector(subject);

            reflector._disposed.Should().BeTrue();
        }
示例#4
0
        public void Dispose_should_not_dispose_forked_handle()
        {
            var subject = new ByteArrayChunk(1);
            var forked  = subject.Fork();

            subject.Dispose();

            var reflector = new Reflector((ByteArrayChunk)forked);

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