Пример #1
0
        public static MySmartContract.Student create(Int32 id, string name, Int32 balance)
        {
            BigInteger sid      = (BigInteger)id;
            BigInteger sbalance = (BigInteger)balance;

            MySmartContract.Student stu = (MySmartContract.Student)MySmartContract.Main("create", sid, "liu", sbalance);

            return(stu);
        }
Пример #2
0
        public void TestDelete()
        {
            MySmartContract.Student stu = TestHelper.create(1, "liu", 100);

            bool delete = (bool)MySmartContract.Main("delete", "liu");

            Assert.AreEqual(true, delete);

            // 0 balance
            BigInteger balance = (BigInteger)MySmartContract.Main("balance", "liu");

            Assert.AreEqual(0, balance);
        }
Пример #3
0
        public void TestBalance()
        {
            // remove all records
            bool delete = (bool)MySmartContract.Main("delete", "liu");

            Assert.AreEqual(true, delete);

            // 0 balance
            BigInteger balance = (BigInteger)MySmartContract.Main("balance", "liu");

            Assert.AreEqual(0, balance);

            // create account
            MySmartContract.Student stu = TestHelper.create(1, "liu", 100);
            Assert.AreEqual(100, stu.balance);

            BigInteger balance2 = (BigInteger)MySmartContract.Main("balance", "liu");

            Assert.AreEqual(100, balance2);
        }