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