Esempio n. 1
0
        public void ReadNull()
        {
            var buffer = new [] { DataCodes.Nil };

            MsgPackSpec.ReadNil(buffer.ToSingleSegment(), out var readSize);
            readSize.ShouldBe(buffer.Length);
        }
Esempio n. 2
0
        public void BadReadNull()
        {
            var buffer = new [] { DataCodes.True };
            var e      = Should.Throw <InvalidOperationException>(() => MsgPackSpec.ReadNil(buffer.ToSingleSegment(), out _));

            e.Message.ShouldBe("Wrong data code: 0xc3. Expected: 0xc0.");
        }