Skip to content

Commit 8837383

Browse files
committed
Merge branch 'next' into ReadyForNoModules
2 parents af05883 + 2ebbf9a commit 8837383

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

Rubberduck.Core/UI/UnitTesting/TestResultToOutcomeTextConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public class TestResultToOutcomeTextConverter : IValueConverter
1010
{
1111
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
1212
{
13-
if (value is TestResult result)
13+
if (value is TestOutcome result)
1414
{
15-
return TestExplorer.ResourceManager.GetString("TestOutcome_" + result.Outcome, CultureInfo.CurrentUICulture);
15+
return TestExplorer.ResourceManager.GetString($"TestOutcome_{result}", CultureInfo.CurrentUICulture);
1616
}
1717

1818
return null;

Rubberduck.Resources/UnitTesting/TestExplorer.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rubberduck.Resources/UnitTesting/TestExplorer.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,7 @@
234234
<data name="TestExplorer_CategoryName" xml:space="preserve">
235235
<value>Category Name</value>
236236
</data>
237+
<data name="TestExplorer_Uncategorized" xml:space="preserve">
238+
<value>Uncategorized</value>
239+
</data>
237240
</root>

Rubberduck.UnitTesting/UnitTesting/TestMethod.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Rubberduck.Parsing.Symbols;
77
using Rubberduck.VBEditor;
88
using Rubberduck.Interaction.Navigation;
9+
using Rubberduck.Resources.UnitTesting;
910

1011
namespace Rubberduck.UnitTesting
1112
{
@@ -25,7 +26,8 @@ public TestCategory Category
2526
var testMethodAnnotation = (TestMethodAnnotation) Declaration.Annotations
2627
.First(annotation => annotation.AnnotationType == AnnotationType.TestMethod);
2728

28-
return new TestCategory(testMethodAnnotation.Category);
29+
var categorization = testMethodAnnotation.Category.Equals(string.Empty) ? TestExplorer.TestExplorer_Uncategorized : testMethodAnnotation.Category;
30+
return new TestCategory(categorization);
2931
}
3032
}
3133

RubberduckTests/UnitTesting/TestMethodTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Sub Foo()
2626
}
2727

2828
[Test]
29-
public void TestCategoryIsEmptyWhenNoCategorySpecified()
29+
public void TestCategoryIsUncategorizedWhenNoCategorySpecified()
3030
{
3131
const string code = @"
3232
'@TestMethod
@@ -38,12 +38,12 @@ Sub Foo()
3838
var testMethodDeclaration = state.AllUserDeclarations.First(declaration => declaration.IdentifierName == "Foo");
3939
var testMethod = new TestMethod(testMethodDeclaration);
4040

41-
Assert.AreEqual("", testMethod.Category.Name);
41+
Assert.AreEqual("Uncategorized", testMethod.Category.Name);
4242
}
4343
}
4444

4545
[Test]
46-
public void TestCategoryIsEmptyWhenSpecifiedCategoryHasWhiteSpaceOnly()
46+
public void TestCategoryIsUncategorizedWhenSpecifiedCategoryHasWhiteSpaceOnly()
4747
{
4848
const string code = @"
4949
'@TestMethod("" "")
@@ -55,7 +55,7 @@ Sub Foo()
5555
var testMethodDeclaration = state.AllUserDeclarations.First(declaration => declaration.IdentifierName == "Foo");
5656
var testMethod = new TestMethod(testMethodDeclaration);
5757

58-
Assert.AreEqual("", testMethod.Category.Name);
58+
Assert.AreEqual("Uncategorized", testMethod.Category.Name);
5959
}
6060
}
6161
}

0 commit comments

Comments
 (0)