public void TestMemoId() { long id = 1234567890; Memo memo = Memo.MemoId(id); Assert.AreEqual(id, memo.Id); Assert.AreEqual(Memo.MemoTypeEnum.MEMO_ID, memo.Type); Stellar.Generated.Memo genMemo = memo.ToXDR(); Assert.AreEqual(new Stellar.Generated.Uint64((ulong)id).InnerValue, genMemo.Id.InnerValue); Assert.AreEqual(Stellar.Generated.MemoType.MemoTypeEnum.MEMO_ID, genMemo.Discriminant.InnerValue); Memo resMemo = Memo.FromXDR(genMemo); Assert.AreEqual(id, resMemo.Id); Assert.AreEqual(Memo.MemoTypeEnum.MEMO_ID, resMemo.Type); }
public void TestMemoIdNegative() { var ex = Assert.Throws <ArgumentException>(() => Memo.MemoId(-1)); Assert.AreEqual(ex.Message, "id must be non-negative."); }