예제 #1
0
        public void Test_Appcall()
        {
            var testengine = new TestEngine();

            testengine.AddAppcallScript("./TestClasses/Contract1.cs", "0102030405060708090A0102030405060708090A");
            //will appcall 0102030405060708090A0102030405060708090A
            testengine.AddEntryScript("./TestClasses/Contract_appcall.cs");

            var       result     = testengine.GetMethod("testfunc").Run();
            StackItem wantresult = new byte[] { 1, 2, 3, 4 };

            var bequal = wantresult.Equals(result);

            Assert.IsTrue(bequal);
        }
        public void Test_Appcall()
        {
            var testengine = new TestEngine();

            testengine.AddAppcallScript("./TestClasses/Contract1.cs", "0102030405060708090A0102030405060708090A");
            //will appcall 0102030405060708090A0102030405060708090A
            testengine.AddEntryScript("./TestClasses/Contract_appcall.cs");

            StackItem[] _params    = new StackItem[] { "testfunc", new StackItem[0] };
            var         result     = testengine.ExecuteTestCase(_params);
            StackItem   wantresult = new byte[] { 1, 2, 3, 4 };

            var bequal = wantresult.Equals(result.Pop());

            Assert.IsTrue(bequal);
        }