public void UnsignedDecodeMax() { var coder = new HeliumIntegerUnsigned(0, false, 1, 0); coder.Prepare(typeof(UInt64)); var decoded = coder.Decode(new DecodeBuffer(UnsignedVlq.Encode(UnsignedVlq.MaxValue).ToArray())); Assert.Equal(UnsignedVlq.MaxValue, decoded); }
public void UnsignedDecodeNullableNull() { var coder = new HeliumIntegerUnsigned(0, true, 1, 0); coder.Prepare(typeof(UInt32?)); var decoded = coder.Decode(new DecodeBuffer(UnsignedVlq.Encode(0).ToArray())); Assert.Equal((UInt32?)null, decoded); }
public void UnsignedDecodeMin() { var coder = new HeliumIntegerUnsigned(0, false, 1, 0); coder.Prepare(typeof(UInt32)); var decoded = coder.Decode(new DecodeBuffer(UnsignedVlq.Encode(0).ToArray())); Assert.Equal((UInt32)0, decoded); }
public void UnsignedDecodeMinimumIncrement2() { var coder = new HeliumIntegerUnsigned(0, false, 10, 20); coder.Prepare(typeof(UInt32)); var decoded = coder.Decode(new DecodeBuffer(new byte[] { 0x0D })); Assert.Equal((UInt32)150, decoded); }