Example #1
0
        public void Dispose()
        {
            try
            {
                if (IsPackageLoaded)
                {
                    UnloadTests();
                }

                if (Runner != null)
                {
                    Runner.Dispose();
                }

                if (TestEngine != null)
                {
                    TestEngine.Dispose();
                }

                if (_assemblyWatcher != null)
                {
                    _assemblyWatcher.Dispose();
                }

                if (_settingsService != null)
                {
                    _settingsService.SaveSettings();
                }
            }
            catch (NUnitEngineUnloadException)
            {
                // TODO: Figure out what to do about this
            }
        }
 protected void Unload()
 {
     if (TestEngine != null)
     {
         TestEngine.Dispose();
         TestEngine = null;
     }
 }
Example #3
0
        public void Dispose()
        {
            if (IsPackageLoaded)
            {
                UnloadTests();
            }

            if (Runner != null)
            {
                Runner.Dispose();
            }

            if (TestEngine != null)
            {
                TestEngine.Dispose();
            }
        }
Example #4
0
        public void attribute_test()
        {
            var verificable = new DummyVerificable(new UInt160(new byte[20]));
            var snapshot    = _system.GetSnapshot().CreateSnapshot();

            using var testengine = new TestEngine(TriggerType.Application, verificable, snapshot: snapshot);
            Assert.IsTrue(testengine.AddEntryScript("./TestClasses/Contract_Attribute.cs").Success);

            var result = testengine.ExecuteTestCaseStandard("test");

            Assert.AreEqual(1, result.Count);
            var item = result.Pop();

            Assert.IsTrue(item.GetBoolean());

            testengine.Reset();
            verificable.Hashes = Array.Empty <UInt160>();

            result = testengine.ExecuteTestCaseStandard("test");
            Assert.AreEqual(VM.VMState.FAULT, testengine.State);
            Assert.AreEqual(0, result.Count);
            testengine.Dispose();
        }
Example #5
0
        public void Dispose()
        {
            try
            {
                if (IsPackageLoaded)
                {
                    UnloadTests();
                }

                if (Runner != null)
                {
                    Runner.Dispose();
                }

                if (TestEngine != null)
                {
                    TestEngine.Dispose();
                }
            }
            catch (NUnitEngineUnloadException)
            {
                // TODO: Figure out what to do about this
            }
        }
Example #6
0
 public void Dispose()
 {
     CloseRunner();
     TestEngine?.Dispose();
 }
Example #7
0
 public new void Dispose()
 {
     _engine.Dispose();
     base.Dispose();
 }
Example #8
0
 public void Cleanup()
 {
     testEngine.Dispose();
 }