-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error message when all discovered projects are test projects
Fixes #3065 Update error handling to provide a clear message when only test projects are found. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/stryker-mutator/stryker-net/issues/3065?shareId=XXXX-XXXX-XXXX-XXXX).
- Loading branch information
1 parent
79d9f40
commit 9290f63
Showing
5 changed files
with
75 additions
and
12 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/Stryker.Abstractions/Exceptions/InvalidProjectsException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
|
||
namespace Stryker.Abstractions.Exceptions; | ||
|
||
/// <summary> | ||
/// Represents error when no test projects are found in the solution or configured for stryker. | ||
/// </summary> | ||
public class InvalidProjectsException : Exception | ||
{ | ||
public InvalidProjectsException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public static InvalidProjectsException NoTestProjectsFound() | ||
{ | ||
return new InvalidProjectsException("No test projects found. Please add a test project to your solution or fix your stryker config."); | ||
} | ||
|
||
public static InvalidProjectsException OnlyTestProjectsFound() | ||
{ | ||
return new InvalidProjectsException("Only test projects found. Please ensure that your solution contains non-test projects."); | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
src/Stryker.Abstractions/Exceptions/NoTestProjectsException.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters