-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for additional extension directories
- Loading branch information
1 parent
037b828
commit 4330169
Showing
11 changed files
with
159 additions
and
39 deletions.
There are no files selected for viewing
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
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
47 changes: 47 additions & 0 deletions
47
src/NUnitConsole/nunit3-console/RequiredExtensionException.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,47 @@ | ||
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt | ||
|
||
using System; | ||
|
||
namespace NUnit.ConsoleRunner | ||
{ | ||
/// <summary> | ||
/// RequiredExtensionException is thrown when the console runner is executed | ||
/// with a command-line option that requires a particular extension and | ||
/// that extension has not been installed. | ||
/// </summary> | ||
public class RequiredExtensionException : Exception | ||
{ | ||
private static string Message1(string extensionName) => $"Required extension {extensionName} is not installed."; | ||
private static string Message2(string extensionName, string option) => $"Option {option} specified but {extensionName} is not installed."; | ||
|
||
/// <summary> | ||
/// Construct with the name of an extension | ||
/// </summary> | ||
public RequiredExtensionException(string extensionName) : base(Message1(extensionName)) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Construct with the name of an extension and the command-line option requiring that extension. | ||
/// </summary> | ||
public RequiredExtensionException(string extensionName, string option) : base(Message2(extensionName, option)) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Construct with the name of an extension and inner exception | ||
/// </summary> | ||
public RequiredExtensionException(string extensionName, Exception innerException) | ||
: base(Message1(extensionName), innerException) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Construct with the name of an extension, a command-line option and inner exception | ||
/// </summary> | ||
public RequiredExtensionException(string extensionName, string option, Exception innerException) | ||
: base(Message2(extensionName, option), innerException) | ||
{ | ||
} | ||
} | ||
} |
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
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