File tree Expand file tree Collapse file tree 4 files changed +19
-5
lines changed
Rubberduck.Resources/UnitTesting
Rubberduck.UnitTesting/UnitTesting
RubberduckTests/UnitTesting Expand file tree Collapse file tree 4 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 234
234
<data name =" TestExplorer_CategoryName" xml : space =" preserve" >
235
235
<value >Category Name</value >
236
236
</data >
237
+ <data name =" TestExplorer_Uncategorized" xml : space =" preserve" >
238
+ <value >Uncategorized</value >
239
+ </data >
237
240
</root >
Original file line number Diff line number Diff line change 6
6
using Rubberduck . Parsing . Symbols ;
7
7
using Rubberduck . VBEditor ;
8
8
using Rubberduck . Interaction . Navigation ;
9
+ using Rubberduck . Resources . UnitTesting ;
9
10
10
11
namespace Rubberduck . UnitTesting
11
12
{
@@ -25,7 +26,8 @@ public TestCategory Category
25
26
var testMethodAnnotation = ( TestMethodAnnotation ) Declaration . Annotations
26
27
. First ( annotation => annotation . AnnotationType == AnnotationType . TestMethod ) ;
27
28
28
- return new TestCategory ( testMethodAnnotation . Category ) ;
29
+ var categorization = testMethodAnnotation . Category . Equals ( string . Empty ) ? TestExplorer . TestExplorer_Uncategorized : testMethodAnnotation . Category ;
30
+ return new TestCategory ( categorization ) ;
29
31
}
30
32
}
31
33
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ Sub Foo()
26
26
}
27
27
28
28
[ Test ]
29
- public void TestCategoryIsEmptyWhenNoCategorySpecified ( )
29
+ public void TestCategoryIsUncategorizedWhenNoCategorySpecified ( )
30
30
{
31
31
const string code = @"
32
32
'@TestMethod
@@ -38,12 +38,12 @@ Sub Foo()
38
38
var testMethodDeclaration = state . AllUserDeclarations . First ( declaration => declaration . IdentifierName == "Foo" ) ;
39
39
var testMethod = new TestMethod ( testMethodDeclaration ) ;
40
40
41
- Assert . AreEqual ( "" , testMethod . Category . Name ) ;
41
+ Assert . AreEqual ( "Uncategorized " , testMethod . Category . Name ) ;
42
42
}
43
43
}
44
44
45
45
[ Test ]
46
- public void TestCategoryIsEmptyWhenSpecifiedCategoryHasWhiteSpaceOnly ( )
46
+ public void TestCategoryIsUncategorizedWhenSpecifiedCategoryHasWhiteSpaceOnly ( )
47
47
{
48
48
const string code = @"
49
49
'@TestMethod("" "")
@@ -55,7 +55,7 @@ Sub Foo()
55
55
var testMethodDeclaration = state . AllUserDeclarations . First ( declaration => declaration . IdentifierName == "Foo" ) ;
56
56
var testMethod = new TestMethod ( testMethodDeclaration ) ;
57
57
58
- Assert . AreEqual ( "" , testMethod . Category . Name ) ;
58
+ Assert . AreEqual ( "Uncategorized " , testMethod . Category . Name ) ;
59
59
}
60
60
}
61
61
}
You can’t perform that action at this time.
0 commit comments