Пример #1
0
 public void UnsignedEncodeUnsupported()
 {
     Assert.Throws <FormatException>(() => {
         var coder = new HeliumIntegerUnsigned(0, false, 10, 20);
         coder.Prepare(typeof(UInt32));
         var encoded = coder.Encode("asdf");
     });
 }
Пример #2
0
        public void UnsignedEncodeMinimumIncrement2()
        {
            var coder = new HeliumIntegerUnsigned(0, false, 10, 20);

            coder.Prepare(typeof(UInt32));
            var encoded = coder.Encode((UInt32)152);

            Assert.Equal("0D", encoded.ToHexString());
        }
Пример #3
0
        public void UnsignedEncodeNullableNull()
        {
            var coder = new HeliumIntegerUnsigned(0, true, 1, 0);

            coder.Prepare(typeof(UInt32?));
            var encoded = coder.Encode((UInt32?)null);

            Assert.Equal(UnsignedVlq.Encode(UnsignedVlq.MinValue).ToHexString(), encoded.ToHexString());
        }
Пример #4
0
        public void UnsignedEncodeMax()
        {
            var coder = new HeliumIntegerUnsigned(0, false, 1, 0);

            coder.Prepare(typeof(UInt64));
            var encoded = coder.Encode(UnsignedVlq.MaxValue);

            Assert.Equal(UnsignedVlq.Encode(UnsignedVlq.MaxValue).ToHexString(), encoded.ToHexString());
        }