コード例 #1
0
        public void TestTrigger()
        {
            var snapshot = Blockchain.Singleton.GetSnapshot();

            ApplicationEngine engine1 = ApplicationEngine.Create(TriggerType.Application, null, snapshot, null, 0);

            Assert.ThrowsException <InvalidOperationException>(() => testNativeContract.TestTrigger(engine1));

            ApplicationEngine engine2 = ApplicationEngine.Create(TriggerType.OnPersist, null, snapshot, null, 0);

            testNativeContract.TestTrigger(engine2);
        }
コード例 #2
0
ファイル: UT_NativeContract.cs プロジェクト: caglarylmz/neo
        public void TestTrigger()
        {
            var snapshot = TestBlockchain.GetTestSnapshot();

            ApplicationEngine engine1 = ApplicationEngine.Create(TriggerType.Application, null, snapshot, settings: TestBlockchain.TheNeoSystem.Settings, gas: 0);

            Assert.ThrowsException <InvalidOperationException>(() => testNativeContract.TestTrigger(engine1));

            ApplicationEngine engine2 = ApplicationEngine.Create(TriggerType.OnPersist, null, snapshot, settings: TestBlockchain.TheNeoSystem.Settings, gas: 0);

            testNativeContract.TestTrigger(engine2);
        }