public void SignedEncodeUnsupported() { Assert.Throws <UnsupportedDataTypeException>(() => { var coder = new HeliumIntegerSigned(0, false, 10); coder.Prepare(typeof(Int32)); var encoded = coder.Encode("asdf"); }); }
public void SignedEncodeIncrement() { var coder = new HeliumIntegerSigned(0, false, 10); coder.Prepare(typeof(Int32)); var encoded = coder.Encode((Int32)111); Assert.Equal("0B", encoded.ToHexString()); }
public void SignedEncodeNullableNull() { var coder = new HeliumIntegerSigned(0, true, 1); coder.Prepare(typeof(Int32?)); var encoded = coder.Encode(null); Assert.Equal(SignedVlq.Encode(0).ToHexString(), encoded.ToHexString()); }
public void SignedEncodeNullableMin() { var coder = new HeliumIntegerSigned(0, true, 1); coder.Prepare(typeof(Int32)); var encoded = coder.Encode(SignedVlq.MinValue + 1); Assert.Equal(SignedVlq.Encode(SignedVlq.MaxValue).ToHexString(), encoded.ToHexString()); }
public void SignedEncodeMax() { var coder = new HeliumIntegerSigned(0, false, 1); coder.Prepare(typeof(Int32)); var encoded = coder.Encode(SignedVlq.MaxValue); Assert.Equal(SignedVlq.Encode(SignedVlq.MaxValue).ToHexString(), encoded.ToHexString()); }