public void SerializeList_ExceptionTest() { BIP0014[] bips = { new BIP0014("Satoshi", new Version(0, 9, 3), null), null, new BIP0014("Satoshi", new Version(0, 12, 3), "comment") }; Assert.Throws <ArgumentNullException>(() => BIP0014.ToByteArrayMulti(bips)); Assert.Throws <ArgumentNullException>(() => BIP0014.ToByteArrayMulti(null)); }
public void ToByteArrayMultiTest() { BIP0014[] bips = { new BIP0014("Satoshi", new Version(0, 9, 3)), new BIP0014("BitcoinJ", new Version(0, 2), "iPad; U; CPU OS 3_2_1"), new BIP0014("AndroidBuild", new Version(0, 8)) }; byte[] actual = BIP0014.ToByteArrayMulti(bips); byte[] expected = Encoding.UTF8.GetBytes("/Satoshi:0.9.3/BitcoinJ:0.2(iPad; U; CPU OS 3_2_1)/AndroidBuild:0.8/"); Assert.Equal(expected, actual); }