Skip to content

Commit 99490c9

Browse files
committed
Annotate Commands Tests
1 parent 759833c commit 99490c9

File tree

5 files changed

+102
-0
lines changed

5 files changed

+102
-0
lines changed

RubberduckTests/Commands/FindAllImplementationsTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace RubberduckTests.Commands
1919
[TestClass]
2020
public class FindAllImplementationsTests
2121
{
22+
[TestCategory("Commands")]
2223
[TestMethod]
2324
public void FindAllImplementations_ReturnsCorrectNumber()
2425
{
@@ -56,6 +57,7 @@ Public Sub IClass1_Foo()
5657
Assert.AreEqual(2, vm.Tabs[0].SearchResults.Count);
5758
}
5859

60+
[TestCategory("Commands")]
5961
[TestMethod]
6062
public void FindAllImplementations_SelectedImplementation_ReturnsCorrectNumber()
6163
{
@@ -93,6 +95,7 @@ Public Sub IClass1_Foo()
9395
Assert.AreEqual(2, vm.Tabs[0].SearchResults.Count);
9496
}
9597

98+
[TestCategory("Commands")]
9699
[TestMethod]
97100
public void FindAllImplementations_SelectedReference_ReturnsCorrectNumber()
98101
{
@@ -136,6 +139,7 @@ Public Sub Buzz()
136139
Assert.AreEqual(2, vm.Tabs[0].SearchResults.Count);
137140
}
138141

142+
[TestCategory("Commands")]
139143
[TestMethod]
140144
public void FindAllImplementations_NoResults_DisplayMessageBox()
141145
{
@@ -168,6 +172,7 @@ public void FindAllImplementations_NoResults_DisplayMessageBox()
168172
It.IsAny<MessageBoxIcon>()), Times.Once);
169173
}
170174

175+
[TestCategory("Commands")]
171176
[TestMethod]
172177
public void FindAllImplementations_SingleResult_Navigates()
173178
{
@@ -206,6 +211,7 @@ Public Sub IClass1_Foo()
206211
navigateCommand.Verify(n => n.Execute(It.IsAny<object>()), Times.Once);
207212
}
208213

214+
[TestCategory("Commands")]
209215
[TestMethod]
210216
public void FindAllImplementations_NullTarget_Aborts()
211217
{
@@ -229,6 +235,7 @@ public void FindAllImplementations_NullTarget_Aborts()
229235
Assert.IsFalse(vm.Tabs.Any());
230236
}
231237

238+
[TestCategory("Commands")]
232239
[TestMethod]
233240
public void FindAllImplementations_StateNotReady_Aborts()
234241
{
@@ -264,6 +271,7 @@ Private Sub Bar()
264271
Assert.IsFalse(vm.Tabs.Any());
265272
}
266273

274+
[TestCategory("Commands")]
267275
[TestMethod]
268276
public void FindAllImplementations_CanExecute_NullTarget()
269277
{
@@ -285,6 +293,7 @@ public void FindAllImplementations_CanExecute_NullTarget()
285293
Assert.IsFalse(command.CanExecute(null));
286294
}
287295

296+
[TestCategory("Commands")]
288297
[TestMethod]
289298
public void FindAllImplementations_CanExecute_StateNotReady()
290299
{
@@ -318,6 +327,7 @@ Private Sub Bar()
318327
Assert.IsFalse(command.CanExecute(parser.State.AllUserDeclarations.Single(s => s.IdentifierName == "Foo")));
319328
}
320329

330+
[TestCategory("Commands")]
321331
[TestMethod]
322332
public void FindAllImplementations_CanExecute_NullActiveCodePane()
323333
{

RubberduckTests/Commands/FindAllReferencesTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace RubberduckTests.Commands
1818
[TestClass]
1919
public class FindAllReferencesTests
2020
{
21+
[TestCategory("Commands")]
2122
[TestMethod]
2223
public void FindAllReferences_ReturnsCorrectNumber()
2324
{
@@ -50,6 +51,7 @@ Private Sub Bar()
5051
Assert.AreEqual(4, vm.Tabs[0].SearchResults.Count);
5152
}
5253

54+
[TestCategory("Commands")]
5355
[TestMethod]
5456
public void FindAllReferences_ReferenceSelected_ReturnsCorrectNumber()
5557
{
@@ -82,6 +84,7 @@ Private Sub Bar()
8284
Assert.AreEqual(4, vm.Tabs[0].SearchResults.Count);
8385
}
8486

87+
[TestCategory("Commands")]
8588
[TestMethod]
8689
public void FindAllReferences_NoResults_DisplayMessageBox()
8790
{
@@ -114,6 +117,7 @@ public void FindAllReferences_NoResults_DisplayMessageBox()
114117
It.IsAny<MessageBoxIcon>()), Times.Once);
115118
}
116119

120+
[TestCategory("Commands")]
117121
[TestMethod]
118122
public void FindAllReferences_SingleResult_Navigates()
119123
{
@@ -146,6 +150,7 @@ Private Sub Bar()
146150
navigateCommand.Verify(n => n.Execute(It.IsAny<object>()), Times.Once);
147151
}
148152

153+
[TestCategory("Commands")]
149154
[TestMethod]
150155
public void FindAllReferences_NullTarget_Aborts()
151156
{
@@ -169,6 +174,7 @@ public void FindAllReferences_NullTarget_Aborts()
169174
Assert.IsFalse(vm.Tabs.Any());
170175
}
171176

177+
[TestCategory("Commands")]
172178
[TestMethod]
173179
public void FindAllReferences_StateNotReady_Aborts()
174180
{
@@ -204,6 +210,7 @@ Private Sub Bar()
204210
Assert.IsFalse(vm.Tabs.Any());
205211
}
206212

213+
[TestCategory("Commands")]
207214
[TestMethod]
208215
public void FindAllReferences_CanExecute_NullTarget()
209216
{
@@ -225,6 +232,7 @@ public void FindAllReferences_CanExecute_NullTarget()
225232
Assert.IsFalse(command.CanExecute(null));
226233
}
227234

235+
[TestCategory("Commands")]
228236
[TestMethod]
229237
public void FindAllReferences_CanExecute_StateNotReady()
230238
{
@@ -258,6 +266,7 @@ Private Sub Bar()
258266
Assert.IsFalse(command.CanExecute(parser.State.AllUserDeclarations.Single(s => s.IdentifierName == "Foo")));
259267
}
260268

269+
[TestCategory("Commands")]
261270
[TestMethod]
262271
public void FindAllReferences_CanExecute_NullActiveCodePane()
263272
{

RubberduckTests/Commands/IndentCommandTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace RubberduckTests.Commands
1515
[TestClass]
1616
public class IndentCommandTests
1717
{
18+
[TestCategory("Commands")]
1819
[TestMethod]
1920
public void AddNoIndentAnnotation()
2021
{
@@ -37,6 +38,7 @@ public void AddNoIndentAnnotation()
3738
Assert.AreEqual("'@NoIndent\r\n", module.Content());
3839
}
3940

41+
[TestCategory("Commands")]
4042
[TestMethod]
4143
public void AddNoIndentAnnotation_ModuleContainsCode()
4244
{
@@ -75,6 +77,7 @@ Sub Foo()
7577
Assert.AreEqual(expected, module.Content());
7678
}
7779

80+
[TestCategory("Commands")]
7881
[TestMethod]
7982
public void AddNoIndentAnnotation_CanExecute_NullActiveCodePane()
8083
{
@@ -96,6 +99,7 @@ public void AddNoIndentAnnotation_CanExecute_NullActiveCodePane()
9699
Assert.IsFalse(noIndentAnnotationCommand.CanExecute(null));
97100
}
98101

102+
[TestCategory("Commands")]
99103
[TestMethod]
100104
public void AddNoIndentAnnotation_CanExecute_ModuleAlreadyHasAnnotation()
101105
{
@@ -117,6 +121,7 @@ public void AddNoIndentAnnotation_CanExecute_ModuleAlreadyHasAnnotation()
117121
Assert.IsFalse(noIndentAnnotationCommand.CanExecute(null));
118122
}
119123

124+
[TestCategory("Commands")]
120125
[TestMethod]
121126
public void IndentModule_IndentsModule()
122127
{
@@ -179,6 +184,7 @@ End Sub
179184
Assert.AreEqual(expected, module2.Content());
180185
}
181186

187+
[TestCategory("Commands")]
182188
[TestMethod]
183189
public void IndentModule_CanExecute_NullActiveCodePane()
184190
{
@@ -201,6 +207,7 @@ public void IndentModule_CanExecute_NullActiveCodePane()
201207
Assert.IsFalse(indentCommand.CanExecute(null));
202208
}
203209

210+
[TestCategory("Commands")]
204211
[TestMethod]
205212
public void IndentModule_CanExecute()
206213
{

0 commit comments

Comments
 (0)