public void Decode() { foreach (var tuple in testCases) { var text = tuple.Item1; var expectedBytes = tuple.Item2; var actualBytes = Base58Encoding.Decode(text); Assert.AreEqual(BitConverter.ToString(expectedBytes), BitConverter.ToString(actualBytes)); } }
public void Encode() { foreach (var tuple in testCases) { var bytes = tuple.Item2; var expectedText = tuple.Item1; var actualText = Base58Encoding.Encode(bytes); Assert.AreEqual(expectedText, actualText); } }
public void DecodeBrokenBitcoinAddress() { var actualBytes = Base58Encoding.DecodeWithCheckSum(brokenAddressText); Assert.AreEqual(BitConverter.ToString(addressBytes), BitConverter.ToString(actualBytes)); }
public void EncodeBitcoinAddress() { var actualText = Base58Encoding.EncodeWithCheckSum(addressBytes); Assert.AreEqual(addressText, actualText); }
public void DecodeInvalidChar() { Base58Encoding.Decode("ab0"); }