コード例 #1
0
ファイル: TestBase.cs プロジェクト: kuber123/sensenet
        public void InitializeTest()
        {
            // workaround for having a half-started repository
            if (RepositoryInstance.Started())
            {
                RepositoryInstance.Shutdown();
            }

            SnTrace.Test.Enabled = true;

            if (_testMethodOperation != null)
            {
                SnTrace.Test.Write("The operation was forced to close.");
                _testMethodOperation.Successful = false;
                _testMethodOperation.Dispose();
            }
            _testMethodOperation = SnTrace.Test.StartOperation("TESTMETHOD: " + TestContext.TestName);
        }
コード例 #2
0
 public void _FinishTest(TestContext testContext)
 {
     if (_snTraceOperation != null)
     {
         _snTraceOperation.Successful = true;
         _snTraceOperation.Dispose();
     }
     SnTrace.Flush();
 }
コード例 #3
0
ファイル: TreeLock.cs プロジェクト: sztomi/sensenet
        public void Dispose()
        {
            DataProvider.Current.ReleaseTreeLock(_lockIds);

            if (this.logOp != null)
            {
                logOp.Successful = true;
                logOp.Dispose();
            }
        }
コード例 #4
0
 public void Dispose()
 {
     //TODO: find a better design instead of calling an asynchronous method
     // synchronously inside a Dispose method.
     DataStore.ReleaseTreeLockAsync(_lockIds, CancellationToken.None).GetAwaiter().GetResult();
     if (_logOp != null)
     {
         _logOp.Successful = true;
         _logOp.Dispose();
     }
 }