public void SkipCString_should_throw_when_subject_is_disposed()
        {
            var stream = Substitute.For<Stream>();
            var subject = new BsonStreamAdapter(stream);
            subject.Dispose();

            Action action = () => subject.SkipCString();

            action.ShouldThrow<ObjectDisposedException>().And.ObjectName.Should().Be("BsonStreamAdapter");
        }
        public void SkipCString_should_throw_when_terminating_null_byte_is_missing()
        {
            var bytes = new byte[] { 97 };
            var stream = new MemoryStream(bytes);
            var subject = new BsonStreamAdapter(stream);

            Action action = () => subject.SkipCString();

            action.ShouldThrow<EndOfStreamException>();
        }
        public void SkipCString_should_skip_cstring(byte[] bytes)
        {
            var stream = new MemoryStream(bytes);
            var subject = new BsonStreamAdapter(stream);

            subject.SkipCString();

            subject.Position.Should().Be(bytes.Length);
        }