コード例 #1
0
        public void TestMemoText()
        {
            string text = "Test";
            Memo   memo = Memo.MemoText(text);

            Assert.AreEqual(text, memo.Text);
            Assert.AreEqual(Memo.MemoTypeEnum.MEMO_TEXT, memo.Type);

            Stellar.Generated.Memo genMemo = memo.ToXDR();

            Assert.AreEqual(text, genMemo.Text);
            Assert.AreEqual(Stellar.Generated.MemoType.MemoTypeEnum.MEMO_TEXT, genMemo.Discriminant.InnerValue);

            Memo resMemo = Memo.FromXDR(genMemo);

            Assert.AreEqual(text, resMemo.Text);
            Assert.AreEqual(Memo.MemoTypeEnum.MEMO_TEXT, resMemo.Type);
        }
コード例 #2
0
        public void TestMemoTextNull()
        {
            var ex = Assert.Throws <NullReferenceException>(() => Memo.MemoText(null));

            Assert.AreEqual(ex.Message, "textorhash cannot be null.");
        }