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); }
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); }
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); }