Skip to content

Commit 504cc38

Browse files
committed
Invert ifs
1 parent b44d168 commit 504cc38

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/Cli/dotnet/commands/dotnet-test/MSBuildHandler.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -134,23 +134,21 @@ private void InitializeTestApplications(IEnumerable<Module> modules)
134134
{
135135
foreach (Module module in modules)
136136
{
137-
if (module.IsTestProject)
137+
if (!module.IsTestProject)
138138
{
139-
if (module.IsTestingPlatformApplication)
140-
{
141-
var testApp = new TestApplication(module, _args);
142-
_testApplications.Add(testApp);
143-
}
144-
else // If one test app has IsTestingPlatformApplication set to false, then we will not run any of the test apps
145-
{
146-
_areTestingPlatformApplications = false;
147-
return;
148-
}
139+
// Non test projects, like the projects that include production code are skipped over, we won't run them.
140+
return;
149141
}
150-
else
142+
143+
if (!module.IsTestingPlatformApplication)
151144
{
152-
// Non test projects, like the projects that include production code are skipped over, we won't run them.
145+
// If one test app has IsTestingPlatformApplication set to false, then we will not run any of the test apps
146+
_areTestingPlatformApplications = false;
147+
return;
153148
}
149+
150+
var testApp = new TestApplication(module, _args);
151+
_testApplications.Add(testApp);
154152
}
155153
}
156154

0 commit comments

Comments
 (0)