TheoryResultCommand
TheoryResultCommand adjusts the result of a Theory so that
it fails if all the results were inconclusive.
using NUnit.Framework.Interfaces;
namespace NUnit.Framework.Internal.Commands
{
public class TheoryResultCommand : AfterTestCommand
{
public TheoryResultCommand(TestCommand command)
: base(command)
{
AfterTest = delegate(TestExecutionContext context) {
TestResult currentResult = context.CurrentResult;
if (currentResult.ResultState == ResultState.Inconclusive) {
if (!currentResult.HasChildren)
currentResult.SetResult(ResultState.Failure, "No test cases were provided");
else
currentResult.SetResult(ResultState.Failure, "All test cases were inconclusive");
}
};
}
}
}