@@ -24,6 +24,7 @@ namespace RubberduckTests.CodeExplorer
24
24
[ TestClass ]
25
25
public class CodeExplorerTests
26
26
{
27
+ [ TestCategory ( "Code Explorer" ) ]
27
28
[ TestMethod ]
28
29
public void AddStdModule ( )
29
30
{
@@ -52,6 +53,7 @@ public void AddStdModule()
52
53
components . Verify ( c => c . Add ( ComponentType . StandardModule ) , Times . Once ) ;
53
54
}
54
55
56
+ [ TestCategory ( "Code Explorer" ) ]
55
57
[ TestMethod ]
56
58
public void AddClassModule ( )
57
59
{
@@ -80,6 +82,7 @@ public void AddClassModule()
80
82
components . Verify ( c => c . Add ( ComponentType . ClassModule ) , Times . Once ) ;
81
83
}
82
84
85
+ [ TestCategory ( "Code Explorer" ) ]
83
86
[ TestMethod ]
84
87
public void AddUserForm ( )
85
88
{
@@ -108,6 +111,7 @@ public void AddUserForm()
108
111
components . Verify ( c => c . Add ( ComponentType . UserForm ) , Times . Once ) ;
109
112
}
110
113
114
+ [ TestCategory ( "Code Explorer" ) ]
111
115
[ TestMethod ]
112
116
public void AddTestModule ( )
113
117
{
@@ -144,6 +148,7 @@ public void AddTestModule()
144
148
components . Verify ( c => c . Add ( ComponentType . StandardModule ) , Times . Once ) ;
145
149
}
146
150
151
+ [ TestCategory ( "Code Explorer" ) ]
147
152
[ TestMethod ]
148
153
public void ImportModule ( )
149
154
{
@@ -186,6 +191,7 @@ public void ImportModule()
186
191
components . Verify ( c => c . Import ( "C:\\ Users\\ Rubberduck\\ Desktop\\ StdModule1.bas" ) , Times . Once ) ;
187
192
}
188
193
194
+ [ TestCategory ( "Code Explorer" ) ]
189
195
[ TestMethod ]
190
196
public void ImportMultipleModules ( )
191
197
{
@@ -229,6 +235,7 @@ public void ImportMultipleModules()
229
235
components . Verify ( c => c . Import ( "C:\\ Users\\ Rubberduck\\ Desktop\\ ClsModule1.cls" ) , Times . Once ) ;
230
236
}
231
237
238
+ [ TestCategory ( "Code Explorer" ) ]
232
239
[ TestMethod ]
233
240
public void ImportModule_Cancel ( )
234
241
{
@@ -271,6 +278,7 @@ public void ImportModule_Cancel()
271
278
components . Verify ( c => c . Import ( "C:\\ Users\\ Rubberduck\\ Desktop\\ StdModule1.bas" ) , Times . Never ) ;
272
279
}
273
280
281
+ [ TestCategory ( "Code Explorer" ) ]
274
282
[ TestMethod ]
275
283
public void ExportModule ( )
276
284
{
@@ -305,6 +313,7 @@ public void ExportModule()
305
313
component . Verify ( c => c . Export ( "C:\\ Users\\ Rubberduck\\ Desktop\\ StdModule1.bas" ) , Times . Once ) ;
306
314
}
307
315
316
+ [ TestCategory ( "Code Explorer" ) ]
308
317
[ TestMethod ]
309
318
public void ExportModule_Cancel ( )
310
319
{
@@ -339,6 +348,7 @@ public void ExportModule_Cancel()
339
348
component . Verify ( c => c . Export ( "C:\\ Users\\ Rubberduck\\ Desktop\\ StdModule1.bas" ) , Times . Never ) ;
340
349
}
341
350
351
+ [ TestCategory ( "Code Explorer" ) ]
342
352
[ TestMethod ]
343
353
public void OpenDesigner ( )
344
354
{
@@ -369,6 +379,7 @@ public void OpenDesigner()
369
379
Assert . IsTrue ( component . Object . DesignerWindow ( ) . IsVisible ) ;
370
380
}
371
381
382
+ [ TestCategory ( "Code Explorer" ) ]
372
383
[ TestMethod ]
373
384
public void RemoveCommand_RemovesModuleWhenPromptOk ( )
374
385
{
@@ -414,6 +425,7 @@ public void RemoveCommand_RemovesModuleWhenPromptOk()
414
425
components . Verify ( c => c . Remove ( component ) , Times . Once ) ;
415
426
}
416
427
428
+ [ TestCategory ( "Code Explorer" ) ]
417
429
[ TestMethod ]
418
430
public void RemoveCommand_CancelsWhenFilePromptCancels ( )
419
431
{
@@ -457,6 +469,7 @@ public void RemoveCommand_CancelsWhenFilePromptCancels()
457
469
components . Verify ( c => c . Remove ( component ) , Times . Never ) ;
458
470
}
459
471
472
+ [ TestCategory ( "Code Explorer" ) ]
460
473
[ TestMethod ]
461
474
public void RemoveCommand_GivenMsgBoxNO_RemovesModuleNoExport ( )
462
475
{
@@ -500,6 +513,7 @@ public void RemoveCommand_GivenMsgBoxNO_RemovesModuleNoExport()
500
513
components . Verify ( c => c . Remove ( component ) , Times . Once ) ;
501
514
}
502
515
516
+ [ TestCategory ( "Code Explorer" ) ]
503
517
[ TestMethod ]
504
518
public void RemoveModule_Cancel ( )
505
519
{
@@ -542,6 +556,7 @@ public void RemoveModule_Cancel()
542
556
components . Verify ( c => c . Remove ( component ) , Times . Never ) ;
543
557
}
544
558
559
+ [ TestCategory ( "Code Explorer" ) ]
545
560
[ TestMethod ]
546
561
public void IndentModule ( )
547
562
{
@@ -584,6 +599,7 @@ End Sub
584
599
Assert . AreEqual ( expectedCode , module . Content ( ) ) ;
585
600
}
586
601
602
+ [ TestCategory ( "Code Explorer" ) ]
587
603
[ TestMethod ]
588
604
public void IndentModule_DisabledWithNoIndentAnnotation ( )
589
605
{
@@ -618,6 +634,7 @@ Dim d As Boolean
618
634
Assert . IsFalse ( vm . IndenterCommand . CanExecute ( vm . SelectedItem ) ) ;
619
635
}
620
636
637
+ [ TestCategory ( "Code Explorer" ) ]
621
638
[ TestMethod ]
622
639
public void IndentProject ( )
623
640
{
@@ -666,6 +683,7 @@ End Sub
666
683
Assert . AreEqual ( expectedCode , module2 . Content ( ) ) ;
667
684
}
668
685
686
+ [ TestCategory ( "Code Explorer" ) ]
669
687
[ TestMethod ]
670
688
public void IndentProject_IndentsModulesWithoutNoIndentAnnotation ( )
671
689
{
@@ -722,6 +740,7 @@ End Sub
722
740
Assert . AreEqual ( inputCode2 , module2 . Content ( ) ) ;
723
741
}
724
742
743
+ [ TestCategory ( "Code Explorer" ) ]
725
744
[ TestMethod ]
726
745
public void IndentProject_DisabledWhenAllModulesHaveNoIndentAnnotation ( )
727
746
{
@@ -759,6 +778,7 @@ Dim d As Boolean
759
778
Assert . IsFalse ( vm . IndenterCommand . CanExecute ( vm . SelectedItem ) ) ;
760
779
}
761
780
781
+ [ TestCategory ( "Code Explorer" ) ]
762
782
[ TestMethod ]
763
783
public void IndentFolder ( )
764
784
{
@@ -811,6 +831,7 @@ End Sub
811
831
Assert . AreEqual ( expectedCode , module2 . Content ( ) ) ;
812
832
}
813
833
834
+ [ TestCategory ( "Code Explorer" ) ]
814
835
[ TestMethod ]
815
836
public void IndentFolder_IndentsModulesWithoutNoIndentAnnotation ( )
816
837
{
@@ -872,6 +893,7 @@ End Sub
872
893
Assert . AreEqual ( inputCode2 , module2 . Content ( ) ) ;
873
894
}
874
895
896
+ [ TestCategory ( "Code Explorer" ) ]
875
897
[ TestMethod ]
876
898
public void IndentFolder_DisabledWhenAllModulesHaveNoIndentAnnotation ( )
877
899
{
@@ -908,6 +930,7 @@ Dim d As Boolean
908
930
Assert . IsFalse ( vm . IndenterCommand . CanExecute ( vm . SelectedItem ) ) ;
909
931
}
910
932
933
+ [ TestCategory ( "Code Explorer" ) ]
911
934
[ TestMethod ]
912
935
public void RenameProcedure ( )
913
936
{
@@ -962,6 +985,7 @@ Sub Bar()
962
985
Assert . AreEqual ( expectedCode , module . Content ( ) ) ;
963
986
}
964
987
988
+ [ TestCategory ( "Code Explorer" ) ]
965
989
[ TestMethod ]
966
990
public void ExpandAllNodes ( )
967
991
{
@@ -991,6 +1015,7 @@ public void ExpandAllNodes()
991
1015
Assert . IsTrue ( vm . Projects . Single ( ) . Items . Single ( ) . Items . Single ( ) . Items . Single ( ) . IsExpanded ) ;
992
1016
}
993
1017
1018
+ [ TestCategory ( "Code Explorer" ) ]
994
1019
[ TestMethod ]
995
1020
public void ExpandAllNodes_StartingWithSubnode ( )
996
1021
{
@@ -1019,6 +1044,7 @@ public void ExpandAllNodes_StartingWithSubnode()
1019
1044
Assert . IsFalse ( vm . Projects . Single ( ) . Items . Last ( ) . IsExpanded ) ;
1020
1045
}
1021
1046
1047
+ [ TestCategory ( "Code Explorer" ) ]
1022
1048
[ TestMethod ]
1023
1049
public void CollapseAllNodes ( )
1024
1050
{
@@ -1048,6 +1074,7 @@ public void CollapseAllNodes()
1048
1074
Assert . IsFalse ( vm . Projects . Single ( ) . Items . Single ( ) . Items . Single ( ) . Items . Single ( ) . IsExpanded ) ;
1049
1075
}
1050
1076
1077
+ [ TestCategory ( "Code Explorer" ) ]
1051
1078
[ TestMethod ]
1052
1079
public void CollapseAllNodes_StartingWithSubnode ( )
1053
1080
{
@@ -1076,13 +1103,15 @@ public void CollapseAllNodes_StartingWithSubnode()
1076
1103
Assert . IsTrue ( vm . Projects . Single ( ) . Items . Last ( ) . IsExpanded ) ;
1077
1104
}
1078
1105
1106
+ [ TestCategory ( "Code Explorer" ) ]
1079
1107
[ TestMethod ]
1080
1108
public void CompareByName_ReturnsZeroForIdenticalNodes ( )
1081
1109
{
1082
1110
var folderNode = new CodeExplorerCustomFolderViewModel ( null , "Name" , "Name" ) ;
1083
1111
Assert . AreEqual ( 0 , new CompareByName ( ) . Compare ( folderNode , folderNode ) ) ;
1084
1112
}
1085
1113
1114
+ [ TestCategory ( "Code Explorer" ) ]
1086
1115
[ TestMethod ]
1087
1116
public void CompareByName_ReturnsZeroForIdenticalNames ( )
1088
1117
{
@@ -1093,6 +1122,7 @@ public void CompareByName_ReturnsZeroForIdenticalNames()
1093
1122
Assert . AreEqual ( 0 , new CompareByName ( ) . Compare ( folderNode1 , folderNode2 ) ) ;
1094
1123
}
1095
1124
1125
+ [ TestCategory ( "Code Explorer" ) ]
1096
1126
[ TestMethod ]
1097
1127
public void CompareByName_ReturnsCorrectOrdering ( )
1098
1128
{
@@ -1103,13 +1133,15 @@ public void CompareByName_ReturnsCorrectOrdering()
1103
1133
Assert . IsTrue ( new CompareByName ( ) . Compare ( folderNode1 , folderNode2 ) < 0 ) ;
1104
1134
}
1105
1135
1136
+ [ TestCategory ( "Code Explorer" ) ]
1106
1137
[ TestMethod ]
1107
1138
public void CompareByType_ReturnsZeroForIdenticalNodes ( )
1108
1139
{
1109
1140
var errorNode = new CodeExplorerCustomFolderViewModel ( null , "Name" , "folder1.folder2" ) ;
1110
1141
Assert . AreEqual ( 0 , new CompareByName ( ) . Compare ( errorNode , errorNode ) ) ;
1111
1142
}
1112
1143
1144
+ [ TestCategory ( "Code Explorer" ) ]
1113
1145
[ TestMethod ]
1114
1146
public void CompareByType_ReturnsEventAboveConst ( )
1115
1147
{
@@ -1137,6 +1169,7 @@ public void CompareByType_ReturnsEventAboveConst()
1137
1169
Assert . AreEqual ( - 1 , new CompareByType ( ) . Compare ( eventNode , constNode ) ) ;
1138
1170
}
1139
1171
1172
+ [ TestCategory ( "Code Explorer" ) ]
1140
1173
[ TestMethod ]
1141
1174
public void CompareByType_ReturnsConstAboveField ( )
1142
1175
{
@@ -1164,6 +1197,7 @@ public void CompareByType_ReturnsConstAboveField()
1164
1197
Assert . AreEqual ( - 1 , new CompareByType ( ) . Compare ( constNode , fieldNode ) ) ;
1165
1198
}
1166
1199
1200
+ [ TestCategory ( "Code Explorer" ) ]
1167
1201
[ TestMethod ]
1168
1202
public void CompareByType_ReturnsFieldAbovePropertyGet ( )
1169
1203
{
@@ -1194,6 +1228,7 @@ End Property
1194
1228
Assert . AreEqual ( - 1 , new CompareByType ( ) . Compare ( fieldNode , propertyGetNode ) ) ;
1195
1229
}
1196
1230
1231
+ [ TestCategory ( "Code Explorer" ) ]
1197
1232
[ TestMethod ]
1198
1233
public void CompareByType_ReturnsPropertyGetAbovePropertyLet ( )
1199
1234
{
@@ -1225,6 +1260,7 @@ End Property
1225
1260
Assert . AreEqual ( - 1 , new CompareByType ( ) . Compare ( propertyGetNode , propertyLetNode ) ) ;
1226
1261
}
1227
1262
1263
+ [ TestCategory ( "Code Explorer" ) ]
1228
1264
[ TestMethod ]
1229
1265
public void CompareByType_ReturnsPropertyLetAbovePropertySet ( )
1230
1266
{
@@ -1256,6 +1292,7 @@ End Property
1256
1292
Assert . AreEqual ( - 1 , new CompareByType ( ) . Compare ( propertyLetNode , propertySetNode ) ) ;
1257
1293
}
1258
1294
1295
+ [ TestCategory ( "Code Explorer" ) ]
1259
1296
[ TestMethod ]
1260
1297
public void CompareByType_ReturnsPropertySetAboveFunction ( )
1261
1298
{
@@ -1287,6 +1324,7 @@ End Function
1287
1324
Assert . AreEqual ( - 1 , new CompareByType ( ) . Compare ( propertySetNode , functionNode ) ) ;
1288
1325
}
1289
1326
1327
+ [ TestCategory ( "Code Explorer" ) ]
1290
1328
[ TestMethod ]
1291
1329
public void CompareByType_ReturnsFunctionAboveSub ( )
1292
1330
{
@@ -1318,6 +1356,7 @@ End Sub
1318
1356
Assert . AreEqual ( - 1 , new CompareByType ( ) . Compare ( functionNode , subNode ) ) ;
1319
1357
}
1320
1358
1359
+ [ TestCategory ( "Code Explorer" ) ]
1321
1360
[ TestMethod ]
1322
1361
public void CompareByType_ReturnsClassModuleBelowDocument ( )
1323
1362
{
@@ -1350,6 +1389,7 @@ public void CompareByType_ReturnsClassModuleBelowDocument()
1350
1389
Assert . AreEqual ( - 1 , new CompareByType ( ) . Compare ( docNode , clsNode ) ) ;
1351
1390
}
1352
1391
1392
+ [ TestCategory ( "Code Explorer" ) ]
1353
1393
[ TestMethod ]
1354
1394
public void CompareBySelection_ReturnsZeroForIdenticalNodes ( )
1355
1395
{
@@ -1381,6 +1421,7 @@ Sub Bar()
1381
1421
Assert . AreEqual ( 0 , new CompareByName ( ) . Compare ( vm . SelectedItem , vm . SelectedItem ) ) ;
1382
1422
}
1383
1423
1424
+ [ TestCategory ( "Code Explorer" ) ]
1384
1425
[ TestMethod ]
1385
1426
public void CompareByNodeType_ReturnsCorrectMemberFirst_MemberPassedFirst ( )
1386
1427
{
@@ -1412,6 +1453,7 @@ Sub Bar()
1412
1453
Assert . AreEqual ( - 1 , new CompareBySelection ( ) . Compare ( memberNode1 , memberNode2 ) ) ;
1413
1454
}
1414
1455
1456
+ [ TestCategory ( "Code Explorer" ) ]
1415
1457
[ TestMethod ]
1416
1458
public void CompareByNodeType_ReturnsZeroForIdenticalNodes ( )
1417
1459
{
@@ -1443,6 +1485,7 @@ Sub Bar()
1443
1485
Assert . AreEqual ( 0 , new CompareByNodeType ( ) . Compare ( vm . SelectedItem , vm . SelectedItem ) ) ;
1444
1486
}
1445
1487
1488
+ [ TestCategory ( "Code Explorer" ) ]
1446
1489
[ TestMethod ]
1447
1490
public void CompareByNodeType_FoldersAreSortedByName ( )
1448
1491
{
@@ -1479,47 +1522,6 @@ private Configuration GetDelimiterConfig()
1479
1522
return new Configuration ( userSettings ) ;
1480
1523
}
1481
1524
1482
- //private IIndenterSettings Settings.IndenterSettingsTests.GetMockIndenterSettings()()
1483
- //{
1484
- // var indenterSettings = new IndenterSettings
1485
- // {
1486
- // IndentEntireProcedureBody = true,
1487
- // IndentFirstCommentBlock = true,
1488
- // IndentFirstDeclarationBlock = true,
1489
- // AlignCommentsWithCode = true,
1490
- // AlignContinuations = true,
1491
- // IgnoreOperatorsInContinuations = true,
1492
- // IndentCase = false,
1493
- // ForceDebugStatementsInColumn1 = false,
1494
- // ForceCompilerDirectivesInColumn1 = false,
1495
- // IndentCompilerDirectives = true,
1496
- // AlignDims = false,
1497
- // AlignDimColumn = 15,
1498
- // EndOfLineCommentStyle = EndOfLineCommentStyle.AlignInColumn,
1499
- // EndOfLineCommentColumnSpaceAlignment = 50,
1500
- // IndentSpaces = 4
1501
- // };
1502
-
1503
- // var settings = new Mock<IndenterSettings>();
1504
- // settings.Setup(s => s.IndentEntireProcedureBody).Returns(true);
1505
- // settings.Setup(s => s.IndentFirstCommentBlock).Returns(true);
1506
- // settings.Setup(s => s.IndentFirstDeclarationBlock).Returns(true);
1507
- // settings.Setup(s => s.AlignCommentsWithCode).Returns(true);
1508
- // settings.Setup(s => s.AlignContinuations).Returns(true);
1509
- // settings.Setup(s => s.IgnoreOperatorsInContinuations).Returns(true);
1510
- // settings.Setup(s => s.IndentCase).Returns(false);
1511
- // settings.Setup(s => s.ForceDebugStatementsInColumn1).Returns(false);
1512
- // settings.Setup(s => s.ForceCompilerDirectivesInColumn1).Returns(false);
1513
- // settings.Setup(s => s.IndentCompilerDirectives).Returns(true);
1514
- // settings.Setup(s => s.AlignDims).Returns(false);
1515
- // settings.Setup(s => s.AlignDimColumn).Returns(15);
1516
- // settings.Setup(s => s.EndOfLineCommentStyle).Returns(EndOfLineCommentStyle.AlignInColumn);
1517
- // settings.Setup(s => s.EndOfLineCommentColumnSpaceAlignment).Returns(50);
1518
- // settings.Setup(s => s.IndentSpaces).Returns(4);
1519
-
1520
- // return indenterSettings;
1521
- //}
1522
-
1523
1525
private ConfigurationLoader GetDelimiterConfigLoader ( )
1524
1526
{
1525
1527
var configLoader = new Mock < ConfigurationLoader > ( null , null , null , null , null , null , null ) ;
0 commit comments