/// <summary>
            ///
            /// </summary>
            public override void Execute()
            {
                lock (_teardownLock)
                {
                    if (Test.TestType == "Theory" && Result.ResultState == ResultState.Success && Result.PassCount == 0)
                    {
                        Result.SetResult(ResultState.Failure, "No test cases were provided");
                    }

                    if (Context.ExecutionStatus != TestExecutionStatus.AbortRequested)
                    {
                        _originalWorkItem.PerformOneTimeTearDown();
                    }

                    foreach (var childResult in Result.Children)
                    {
                        if (childResult.ResultState == ResultState.Cancelled)
                        {
                            this.Result.SetResult(ResultState.Cancelled, "Cancelled by user");
                            break;
                        }
                    }

                    _originalWorkItem.WorkItemComplete();
                }
            }
示例#2
0
            /// <summary>
            ///
            /// </summary>
            public override void Execute()
            {
                lock (_teardownLock)
                {
                    //if (Test.Parent != null && Test.Parent.Name.EndsWith("nunit.framework.tests.dll"))
                    //    System.Diagnostics.Debugger.Launch();

                    if (Test.TestType == "Theory" && Result.ResultState == ResultState.Success && Result.PassCount == 0)
                    {
                        Result.SetResult(ResultState.Failure, "No test cases were provided");
                    }

                    if (Context.ExecutionStatus != TestExecutionStatus.AbortRequested)
                    {
                        _originalWorkItem.PerformOneTimeTearDown();
                    }

                    foreach (var childResult in Result.Children)
                    {
                        if (childResult.ResultState == ResultState.Cancelled)
                        {
                            this.Result.SetResult(ResultState.Cancelled, "Cancelled by user");
                            break;
                        }
                    }

                    _originalWorkItem.WorkItemComplete();
                }
            }