Browse Source

Prevent test case failure showing test as passed.

When using test data source, where some data fails, following item
that is successful, overwrites "red" status to "green" again in the
Unit Tests window.

This is a workaround. Ideally SharpDevelop would have proper support
for test cases, such as showing them in the Unit Tests window and
being able to run individual test cases.

Fixes #726
pull/741/merge
ddur 9 years ago committed by Matt Ward
parent
commit
d238d28a53
  1. 3
      src/AddIns/Analysis/UnitTesting/Model/TestBase.cs

3
src/AddIns/Analysis/UnitTesting/Model/TestBase.cs

@ -65,6 +65,9 @@ namespace ICSharpCode.UnitTesting @@ -65,6 +65,9 @@ namespace ICSharpCode.UnitTesting
void ChangeResult(TestResultType newResult)
{
TestResultType oldResult = result;
if (oldResult == TestResultType.Failure && newResult == TestResultType.Success) {
return; // do not revert result from failure to success (Test with data source)
}
if (oldResult != newResult) {
result = newResult;
OnResultChanged(new TestResultTypeChangedEventArgs(oldResult, newResult));

Loading…
Cancel
Save