Esempio n. 1
0
        public async Task Encode_DecodeRoundtrip_ReturnsInput(ulong input)
        {
            var pipe = new Pipe();
            await VarUInt.Encode(input, pipe.Writer);

            Assert.That(VarUInt.Decode(pipe.Reader), Is.EqualTo(input));
        }
Esempio n. 2
0
        public void Decode_MissingFollowup_Throws()
        {
            var stream = PipeReader.Create(new MemoryStream(new byte[] { 172 }));

            Assert.That(() => VarUInt.Decode(stream), Throws.Exception);
        }
Esempio n. 3
0
        public ulong Decode_FullInput_ReturnsCorrectValue(byte[] input)
        {
            var str = PipeReader.Create(new MemoryStream(input));

            return(VarUInt.Decode(str));
        }