コード例 #1
0
        public void TestAddBigInt()
        {
            BlobBuilder builder = new BlobBuilder();
            BigInteger  value   = new BigInteger("12398259028592293582039293420948023");

            builder.AddBigIntBlob(value);
            byte[] valueBytes = value.ToByteArrayUnsigned();
            //Assert.That(valueBytes[0], Is.EqualTo(0));
            byte[] expected = new byte[valueBytes.Length + 4];
            Array.Copy(valueBytes.Length.ToBytes(), expected, 4);
            Array.Copy(valueBytes, 0, expected, 4, valueBytes.Length);
            Assert.That(builder.GetBlob(), Is.EqualTo(expected));
        }