コード例 #1
0
        public void TestAddBlob()
        {
            BlobBuilder builder = new BlobBuilder();

            byte[] blob = { 0, 1, 2, 3, 4, 5 };
            builder.AddBlob(blob);
            byte[] expected = new byte[blob.Length + 4];
            Array.Copy(blob.Length.ToBytes(), expected, 4);
            Array.Copy(blob, 0, expected, 4, blob.Length);
            Assert.That(builder.GetBlob(), Is.EqualTo(expected));
        }