Skip to content

Commit

Permalink
Finish filtering & Remove easter egg
Browse files Browse the repository at this point in the history
Remove all usage and reference to SpectacularFail easter egg.
  • Loading branch information
IvenBach committed Jul 20, 2019
1 parent 5cafc06 commit 7ba5932
Show file tree
Hide file tree
Showing 18 changed files with 5 additions and 126 deletions.
13 changes: 0 additions & 13 deletions Rubberduck.Core/UI/UnitTesting/TestExplorerControl.xaml
Expand Up @@ -50,7 +50,6 @@

<BitmapImage x:Key="FilterImage" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/Funnel.png" />
<BitmapImage x:Key="OutcomeUnknown" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/question-white.png" />
<BitmapImage x:Key="OutcomeSpectacularFail" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/skull-mad.png" />
<BitmapImage x:Key="OutcomeFail" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/cross-circle.png" />
<BitmapImage x:Key="OutcomeInconclusive" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/exclamation.png" />
<BitmapImage x:Key="OutcomeSucceeded" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/tick-circle.png" />
Expand Down Expand Up @@ -235,11 +234,6 @@
IsChecked="{Binding Path=OutcomeFilter, Converter={StaticResource OutcomeFilterConverter}, ConverterParameter={x:Static local:TestExplorerOutcomeFilter.Unknown}}" >
<Image Source="{StaticResource OutcomeUnknown}" />
</ToggleButton>
<ToggleButton Style="{StaticResource ToolBarToggleStyle}"
ToolTip="{Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=TestOutcome_SpectacularFail}"
IsChecked="{Binding Path=OutcomeFilter, Converter={StaticResource OutcomeFilterConverter}, ConverterParameter={x:Static local:TestExplorerOutcomeFilter.SpectacularFail}}" >
<Image Source="{StaticResource OutcomeSpectacularFail}" />
</ToggleButton>
<ToggleButton Style="{StaticResource ToolBarToggleStyle}"
ToolTip="{Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=TestOutcome_Fail}"
IsChecked="{Binding Path=OutcomeFilter, Converter={StaticResource OutcomeFilterConverter}, ConverterParameter={x:Static local:TestExplorerOutcomeFilter.Fail}}" >
Expand Down Expand Up @@ -318,13 +312,6 @@
<TextBlock Margin="2" Padding="4,2,4,2" FontWeight="Bold" VerticalAlignment="Center"
Text="{Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestOutcome_SummaryCaption}"/>
<TextBlock Style="{StaticResource ResultsTestOutcomeStyle}" Text="{Binding Model.LastTestRunSummary, Mode=OneWay}"/>
<StackPanel Orientation="Horizontal" Visibility="{Binding Model.LastTestSpectacularFailCount, Mode=OneWay, Converter={StaticResource NonZeroToVisibility}}" >
<Image Style="{StaticResource TestOutcomeIconStyle}" Source="{StaticResource EasterEggTestImage}" Margin="4,0,4,0"/>
<TextBlock Style="{StaticResource ResultsTestOutcomeStyle}">
<Run Text="{Binding Model.LastTestSpectacularFailCount, Mode=OneWay}"/>
<Run Text="{Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestOutcome_SpectacularFail}"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding Model.LastTestFailedCount, Mode=OneWay, Converter={StaticResource NonZeroToVisibility}}" >
<Image Style="{StaticResource TestOutcomeIconStyle}" Source="{StaticResource RunFailedTestsImage}" Margin="4,0,4,0"/>
<TextBlock Style="{StaticResource ResultsTestOutcomeStyle}">
Expand Down
4 changes: 0 additions & 4 deletions Rubberduck.Core/UI/UnitTesting/TestExplorerModel.cs
Expand Up @@ -100,8 +100,6 @@ public bool IsRefreshing
public string LastTestRunSummary =>
string.Format(Resources.UnitTesting.TestExplorer.TestOutcome_RunSummaryFormat, CurrentRunTestCount, Tests.Count, TimeSpan.FromMilliseconds(TotalDuration));

public int LastTestSpectacularFailCount => Tests.Count(test => test.Result.Outcome == TestOutcome.SpectacularFail && _testEngine.LastRunTests.Contains(test.Method));

public int LastTestFailedCount => Tests.Count(test => test.Result.Outcome == TestOutcome.Failed && _testEngine.LastRunTests.Contains(test.Method));

public int LastTestInconclusiveCount => Tests.Count(test => test.Result.Outcome == TestOutcome.Inconclusive && _testEngine.LastRunTests.Contains(test.Method));
Expand Down Expand Up @@ -181,7 +179,6 @@ private void HandleRunCompletion(object sender, TestRunCompletedEventArgs e)
IsBusy = false;

OnPropertyChanged(nameof(LastTestRunSummary));
OnPropertyChanged(nameof(LastTestSpectacularFailCount));
OnPropertyChanged(nameof(LastTestFailedCount));
OnPropertyChanged(nameof(LastTestIgnoredCount));
OnPropertyChanged(nameof(LastTestInconclusiveCount));
Expand Down Expand Up @@ -246,7 +243,6 @@ private void OnTestCompleted(TestCompletedEventArgs args)
{ TestOutcome.Inconclusive, Colors.Gold },
{ TestOutcome.Ignored, Colors.Orange },
{ TestOutcome.Failed, Colors.Red },
{ TestOutcome.SpectacularFail, Colors.Black }
};

private TestOutcome _worstOutcome = TestOutcome.Unknown;
Expand Down
9 changes: 4 additions & 5 deletions Rubberduck.Core/UI/UnitTesting/TestExplorerViewModel.cs
Expand Up @@ -34,11 +34,10 @@ public enum TestExplorerOutcomeFilter
{
None = 0,
Unknown = 1,
SpectacularFail = 1 << 1,
Fail = 1 << 2,
Inconclusive = 1 << 3,
Succeeded = 1 << 4,
All = Unknown | SpectacularFail | Fail | Inconclusive | Succeeded
Fail = 1 << 1,
Inconclusive = 1 << 2,
Succeeded = 1 << 3,
All = Unknown | Fail | Inconclusive | Succeeded
}

internal sealed class TestExplorerViewModel : ViewModelBase, INavigateSelection, IDisposable
Expand Down
Expand Up @@ -22,8 +22,7 @@ public class TestOutcomeImageSourceConverter : ImageSourceConverter, IMultiValue
{ TestOutcome.Succeeded, ToImageSource(RubberduckUI.tick_circle) },
{ TestOutcome.Failed, ToImageSource(RubberduckUI.cross_circle) },
{ TestOutcome.Inconclusive, ToImageSource(RubberduckUI.exclamation) },
{ TestOutcome.Ignored, ToImageSource(RubberduckUI.minus_white) },
{ TestOutcome.SpectacularFail, ToImageSource(RubberduckUI.skull_mad) }
{ TestOutcome.Ignored, ToImageSource(RubberduckUI.minus_white) }
};

public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Expand Down
19 changes: 0 additions & 19 deletions Rubberduck.Resources/RubberduckUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions Rubberduck.Resources/RubberduckUI.resx
Expand Up @@ -1537,9 +1537,6 @@ NOTE: Restart is required for the setting to take effect.</value>
<data name="hourglass" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\Fugue\hourglass.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="skull_mad" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\Fugue\skull-mad.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Language_ES" xml:space="preserve">
<value>Español</value>
</data>
Expand Down Expand Up @@ -1599,9 +1596,6 @@ NOTE: Restart is required for the setting to take effect.</value>
<data name="TestOutcome_Inconclusive" xml:space="preserve">
<value>Inconclusive</value>
</data>
<data name="TestOutcome_SpectacularFail" xml:space="preserve">
<value>SpectacularFail</value>
</data>
<data name="TestOutcome_Succeeded" xml:space="preserve">
<value>Suceeded</value>
</data>
Expand Down
9 changes: 0 additions & 9 deletions Rubberduck.Resources/UnitTesting/TestExplorer.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Rubberduck.Resources/UnitTesting/TestExplorer.cs.resx
Expand Up @@ -324,7 +324,4 @@
<data name="TestOutcome_SummaryCaption" xml:space="preserve">
<value>Shrnutí:</value>
</data>
<data name="TestOutcome_SpectacularFail" xml:space="preserve">
<value>Pozoruhodné Selhání</value>
</data>
</root>
3 changes: 0 additions & 3 deletions Rubberduck.Resources/UnitTesting/TestExplorer.de.resx
Expand Up @@ -297,9 +297,6 @@
<data name="TestOutcome_SummaryCaption" xml:space="preserve">
<value>Zusammenfassung:</value>
</data>
<data name="TestOutcome_SpectacularFail" xml:space="preserve">
<value>Spektakulärer Fehlschlag</value>
</data>
<data name="TestOutcome_RunSummaryFormat" xml:space="preserve">
<value>{0} von {1} Test(s) ausgeführt. (Laufzeit: {2:g})</value>
</data>
Expand Down
3 changes: 0 additions & 3 deletions Rubberduck.Resources/UnitTesting/TestExplorer.es.resx
Expand Up @@ -312,7 +312,4 @@
<data name="TestOutcome_SummaryCaption" xml:space="preserve">
<value>Resumen:</value>
</data>
<data name="TestOutcome_SpectacularFail" xml:space="preserve">
<value>Fracaso espectacular</value>
</data>
</root>
3 changes: 0 additions & 3 deletions Rubberduck.Resources/UnitTesting/TestExplorer.fr.resx
Expand Up @@ -252,9 +252,6 @@
<data name="TestOutcome_RunSummaryFormat" xml:space="preserve">
<value>{0} de {1} test(s) exécuté(s) (temps d'exécution: {2:g})</value>
</data>
<data name="TestOutcome_SpectacularFail" xml:space="preserve">
<value>Échec Spectaculaire</value>
</data>
<data name="TestOutcome_SummaryCaption" xml:space="preserve">
<value>Sommaire:</value>
</data>
Expand Down
4 changes: 0 additions & 4 deletions Rubberduck.Resources/UnitTesting/TestExplorer.resx
Expand Up @@ -339,10 +339,6 @@
<data name="TestOutcome_SummaryCaption" xml:space="preserve">
<value>Summary:</value>
</data>
<data name="TestOutcome_SpectacularFail" xml:space="preserve">
<value>Spectacular Failure</value>
<comment>Easter egg status.</comment>
</data>
<data name="TestExplorer_Filter" xml:space="preserve">
<value>Test Name</value>
</data>
Expand Down
5 changes: 0 additions & 5 deletions Rubberduck.UnitTesting/UnitTesting/TestEngine.cs
Expand Up @@ -368,11 +368,6 @@ private TestResult EvaluateResults(IEnumerable<AssertCompletedEventArgs> assertR
var result = new AssertCompletedEventArgs(TestOutcome.Succeeded);
var asserted = assertResults.ToList();

if (asserted.Count(assert => assert.Outcome == TestOutcome.Failed) >= 10)
{
return new TestResult(TestOutcome.SpectacularFail, result.Message, duration);
}

if (asserted.Any(assertion => assertion.Outcome != TestOutcome.Succeeded))
{
result = asserted.First(assertion => assertion.Outcome != TestOutcome.Succeeded);
Expand Down
1 change: 0 additions & 1 deletion Rubberduck.UnitTesting/UnitTesting/TestOutcome.cs
Expand Up @@ -3,7 +3,6 @@
public enum TestOutcome
{
Unknown,
SpectacularFail,
Failed,
Ignored,
Inconclusive,
Expand Down
2 changes: 0 additions & 2 deletions RubberduckTests/UnitTesting/EngineTests.cs
Expand Up @@ -171,7 +171,6 @@ private void SetupAndTestAssertAndReturn(Action action, TestResult expected)
{ TestOutcome.Succeeded, (TestOutcome.Succeeded, "", 0) },
{ TestOutcome.Inconclusive, (TestOutcome.Inconclusive, "", 0) },
{ TestOutcome.Failed, (TestOutcome.Failed, "", 0) },
{ TestOutcome.SpectacularFail, (TestOutcome.SpectacularFail, "", 0) },
{ TestOutcome.Ignored, (TestOutcome.Ignored, "", 0) }
};

Expand All @@ -184,7 +183,6 @@ private void SetupAndTestAssertAndReturn(Action action, TestResult expected)
//[TestCase(new object[] { TestOutcome.Failed, TestOutcome.Failed, TestOutcome.Failed })]
//[TestCase(new object[] { TestOutcome.Succeeded, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.Ignored, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.SpectacularFail })]
//[Category("Unit Testing")]
//public void TestEngine_LastTestRun_UpdatesAfterRun(params TestOutcome[] tests)
//{
Expand Down
10 changes: 0 additions & 10 deletions RubberduckTests/UnitTesting/MockedTestEngine.cs
Expand Up @@ -162,16 +162,6 @@ public void SetupAssertCompleted(TestMethod testMethod, TestResult result)
// but only if the context is force by running them through the debugger. Leaving these in as commented code mainly for
// the purpose of documenting this. Single asserts are fine. Update - added spin wait instead. This may still be a FIXME?

case TestOutcome.SpectacularFail:
action = () =>
{
var assert = new AssertClass();
for (var failure = 0; failure < 10; failure++)
{
assert.Fail(result.Output);
}
};
break;
case TestOutcome.Failed:
action = () =>
{
Expand Down
32 changes: 0 additions & 32 deletions RubberduckTests/UnitTesting/TestExplorerModelTests.cs
Expand Up @@ -53,7 +53,6 @@ public void ExecutedCount_MatchesNumberOfTestsRun(int testCount)
{ TestOutcome.Succeeded, (TestOutcome.Succeeded, "", DummyTestDuration) },
{ TestOutcome.Inconclusive, (TestOutcome.Inconclusive, "", DummyTestDuration) },
{ TestOutcome.Failed, (TestOutcome.Failed, "", DummyTestDuration) },
{ TestOutcome.SpectacularFail, (TestOutcome.SpectacularFail, "", DummyTestDuration) },
{ TestOutcome.Ignored, (TestOutcome.Ignored, "", DummyTestDuration) }
};

Expand All @@ -65,7 +64,6 @@ public void ExecutedCount_MatchesNumberOfTestsRun(int testCount)
//[TestCase(new object[] { TestOutcome.Failed, TestOutcome.Failed, TestOutcome.Failed })]
//[TestCase(new object[] { TestOutcome.Succeeded, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.Ignored, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.SpectacularFail })]
//[Category("Unit Testing")]
//public void LastTestSucceededCount_CountIsCorrect(params TestOutcome[] tests)
//{
Expand All @@ -90,7 +88,6 @@ public void ExecutedCount_MatchesNumberOfTestsRun(int testCount)
//[TestCase(new object[] { TestOutcome.Failed, TestOutcome.Failed, TestOutcome.Failed })]
//[TestCase(new object[] { TestOutcome.Succeeded, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.Ignored, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.SpectacularFail })]
//[Category("Unit Testing")]
//public void LastTestIgnoredCount_CountIsCorrect(params TestOutcome[] tests)
//{
Expand All @@ -115,7 +112,6 @@ public void ExecutedCount_MatchesNumberOfTestsRun(int testCount)
//[TestCase(new object[] { TestOutcome.Failed, TestOutcome.Failed, TestOutcome.Failed })]
//[TestCase(new object[] { TestOutcome.Succeeded, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.Ignored, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.SpectacularFail })]
//[Category("Unit Testing")]
//public void LastTestInconclusiveCount_CountIsCorrect(params TestOutcome[] tests)
//{
Expand All @@ -140,7 +136,6 @@ public void ExecutedCount_MatchesNumberOfTestsRun(int testCount)
//[TestCase(new object[] { TestOutcome.Failed, TestOutcome.Failed, TestOutcome.Failed })]
//[TestCase(new object[] { TestOutcome.Succeeded, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.Ignored, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.SpectacularFail })]
//[Category("Unit Testing")]
//public void LastTestFailedCount_CountIsCorrect(params TestOutcome[] tests)
//{
Expand All @@ -157,31 +152,6 @@ public void ExecutedCount_MatchesNumberOfTestsRun(int testCount)
// }
//}

//[Test]
//[TestCase(new object[] { TestOutcome.Succeeded, TestOutcome.Failed })]
//[TestCase(new object[] { TestOutcome.Succeeded, TestOutcome.Succeeded, TestOutcome.Succeeded })]
//[TestCase(new object[] { TestOutcome.Succeeded, TestOutcome.Inconclusive, TestOutcome.Failed })]
//[TestCase(new object[] { TestOutcome.Inconclusive, TestOutcome.Inconclusive, TestOutcome.Inconclusive })]
//[TestCase(new object[] { TestOutcome.Failed, TestOutcome.Failed, TestOutcome.Failed })]
//[TestCase(new object[] { TestOutcome.Succeeded, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.SpectacularFail, TestOutcome.SpectacularFail, TestOutcome.Ignored })]
//[TestCase(new object[] { TestOutcome.Ignored, TestOutcome.SpectacularFail })]
//[Category("Unit Testing")]
//public void LastTestSpectacularFailCount_CountIsCorrect(params TestOutcome[] tests)
//{
// var underTest = tests.Select(test => DummyOutcomes[test]).ToList();

// using (var model = new MockedTestExplorerModel(underTest))
// {
// model.Engine.ParserState.OnParseRequested(model);
// model.Model.ExecuteTests(model.Model.Tests);
// Thread.SpinWait(25);

// var expected = tests.Count(outcome => outcome == TestOutcome.SpectacularFail);
// Assert.AreEqual(expected, model.Model.LastTestSpectacularFailCount);
// }
//}

[Test]
[Category("Unit Testing")]
public void CancelTestRun_RequestsCancellation()
Expand All @@ -203,7 +173,6 @@ public void CancelTestRun_RequestsCancellation()
{ "Gold", Colors.Gold },
{ "Orange", Colors.Orange },
{ "Red", Colors.Red },
{ "Black", Colors.Black }
};

//[Test]
Expand All @@ -214,7 +183,6 @@ public void CancelTestRun_RequestsCancellation()
//[TestCase("Gold", new [] { TestOutcome.Inconclusive, TestOutcome.Inconclusive, TestOutcome.Succeeded })]
//[TestCase("Red", new [] { TestOutcome.Failed, TestOutcome.Failed, TestOutcome.Failed })]
//[TestCase("Orange", new [] { TestOutcome.Succeeded, TestOutcome.Ignored })]
//[TestCase("Black", new[] { TestOutcome.Ignored, TestOutcome.SpectacularFail })]
//[Category("Unit Testing")]
//public void ProgressBarColor_CorrectGivenTestResult(params object[] args)
//{
Expand Down
2 changes: 0 additions & 2 deletions RubberduckTests/UnitTesting/ViewModelTests.cs
Expand Up @@ -77,7 +77,6 @@ public void TestGrouping_ChangesUpdateGroups(TestExplorerGrouping grouping, stri
{ TestOutcome.Succeeded, (TestOutcome.Succeeded, "", 0) },
{ TestOutcome.Inconclusive, (TestOutcome.Inconclusive, "", 0) },
{ TestOutcome.Failed, (TestOutcome.Failed, "", 0) },
{ TestOutcome.SpectacularFail, (TestOutcome.SpectacularFail, "", 0) },
{ TestOutcome.Ignored, (TestOutcome.Ignored, "", 0) }
};

Expand All @@ -91,7 +90,6 @@ public void TestGrouping_ChangesUpdateGroups(TestExplorerGrouping grouping, stri
//[TestCase(new[] { TestOutcome.Failed, TestOutcome.Failed, TestOutcome.Failed })]
//[TestCase(new[] { TestOutcome.Succeeded, TestOutcome.Ignored })]
//[TestCase(new[] { TestOutcome.Succeeded, TestOutcome.Ignored, TestOutcome.Failed })]
//[TestCase(new[] { TestOutcome.Ignored, TestOutcome.SpectacularFail })]
//public void TestGrouping_GroupsByOutcome(params TestOutcome[] tests)
//{
// var underTest = tests.Select(test => DummyOutcomes[test]).ToList();
Expand Down

0 comments on commit 7ba5932

Please sign in to comment.