@@ -25,27 +25,6 @@ namespace GoogleTestAdapter
25
25
public class GoogleTestDiscovererTests : TestsBase
26
26
{
27
27
28
- [ TestMethod ]
29
- [ TestCategory ( Unit ) ]
30
- public void IsGoogleTestExecutable_MatchingExamples_AreMatched ( )
31
- {
32
- AssertIsGoogleTestExecutable ( "MyGoogleTests.exe" , true ) ;
33
- AssertIsGoogleTestExecutable ( "MyGoogleTests.exe" , true ) ;
34
- AssertIsGoogleTestExecutable ( "MyGoogleTest.exe" , true ) ;
35
- AssertIsGoogleTestExecutable ( "mygoogletests.exe" , true ) ;
36
- AssertIsGoogleTestExecutable ( "mygoogletest.exe" , true ) ;
37
- }
38
-
39
- [ TestMethod ]
40
- [ TestCategory ( Unit ) ]
41
- public void IsGoogleTestExecutable_NotMatchingExamples_AreNotMatched ( )
42
- {
43
- AssertIsGoogleTestExecutable ( "MyGoogleTes.exe" , false ) ;
44
- AssertIsGoogleTestExecutable ( "TotallyWrong.exe" , false ) ;
45
- AssertIsGoogleTestExecutable ( "TestStuff.exe" , false ) ;
46
- AssertIsGoogleTestExecutable ( "TestLibrary.exe" , false ) ;
47
- }
48
-
49
28
[ TestMethod ]
50
29
[ TestCategory ( Unit ) ]
51
30
public void IsGoogleTestExecutable_WithRegexFromOptions_MatchesCorrectly ( )
@@ -59,7 +38,7 @@ public void IsGoogleTestExecutable_WithRegexFromOptions_MatchesCorrectly()
59
38
[ TestCategory ( Unit ) ]
60
39
public void IsGoogleTestExecutable_WithUnparsableRegexFromOptions_ProducesErrorMessage ( )
61
40
{
62
- bool result = new GoogleTestDiscoverer ( TestEnvironment . Logger , TestEnvironment . Options ) . IsGoogleTestExecutable ( "my.exe" , "d[ddd[" ) ;
41
+ bool result = GoogleTestDiscoverer . IsGoogleTestExecutable ( "my.exe" , "d[ddd[" , TestEnvironment . Logger ) ;
63
42
64
43
result . Should ( ) . BeFalse ( ) ;
65
44
MockLogger . Verify ( l => l . LogError ( It . Is < string > ( s => s . Contains ( "'d[ddd['" ) ) ) , Times . Exactly ( 1 ) ) ;
@@ -72,8 +51,8 @@ public void IsGoogleTestExecutable_WithIndicatorFile_IsRecognizedAsTestExecutabl
72
51
string testExecutable = SetupIndicatorFileTest ( true ) ;
73
52
try
74
53
{
75
- bool result = new GoogleTestDiscoverer ( TestEnvironment . Logger , TestEnvironment . Options )
76
- . IsGoogleTestExecutable ( testExecutable ) ;
54
+ bool result = GoogleTestDiscoverer
55
+ . IsGoogleTestExecutable ( testExecutable , "" , TestEnvironment . Logger ) ;
77
56
78
57
result . Should ( ) . BeTrue ( ) ;
79
58
}
@@ -86,15 +65,15 @@ public void IsGoogleTestExecutable_WithIndicatorFile_IsRecognizedAsTestExecutabl
86
65
87
66
[ TestMethod ]
88
67
[ TestCategory ( Unit ) ]
89
- public void IsGoogleTestExecutable_WithoutIndicatorFile_IsNotRecognizedAsTestExecutable ( )
68
+ public void IsGoogleTestExecutable_WithoutIndicatorFile_IsRecognizedAsTestExecutable ( )
90
69
{
91
70
string testExecutable = SetupIndicatorFileTest ( false ) ;
92
71
try
93
72
{
94
- bool result = new GoogleTestDiscoverer ( TestEnvironment . Logger , TestEnvironment . Options )
95
- . IsGoogleTestExecutable ( testExecutable ) ;
73
+ bool result = GoogleTestDiscoverer
74
+ . IsGoogleTestExecutable ( testExecutable , "" , TestEnvironment . Logger ) ;
96
75
97
- result . Should ( ) . BeFalse ( ) ;
76
+ result . Should ( ) . BeTrue ( ) ;
98
77
}
99
78
finally
100
79
{
@@ -320,7 +299,7 @@ public void GetTestsFromExecutable_LoadTests_AreFoundInReasonableTime()
320
299
321
300
private void AssertIsGoogleTestExecutable ( string executable , bool isGoogleTestExecutable , string regex = "" )
322
301
{
323
- new GoogleTestDiscoverer ( TestEnvironment . Logger , TestEnvironment . Options ) . IsGoogleTestExecutable ( executable , regex )
302
+ GoogleTestDiscoverer . IsGoogleTestExecutable ( executable , regex , TestEnvironment . Logger )
324
303
. Should ( )
325
304
. Be ( isGoogleTestExecutable ) ;
326
305
}
0 commit comments