-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eca545f
commit 2b47f9f
Showing
6 changed files
with
88 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using GoCommando.Internals; | ||
using NUnit.Framework; | ||
|
||
namespace GoCommando.Tests | ||
{ | ||
[TestFixture] | ||
public class TestCommand | ||
{ | ||
[TestCase("-switch:value2")] | ||
[TestCase("-switch=value2")] | ||
[TestCase(@"-switch""value2""")] | ||
public void CanCorrectlyHandleDifferentAlternativeSwitchFormatsFoundInOneSingleTokenOnly(string switchText) | ||
{ | ||
var settings = new Settings(); | ||
var invoker = new CommandInvoker("bimse", settings, new Bimse()); | ||
var arguments = Go.Parse(new[] {switchText}, settings); | ||
|
||
invoker.Invoke(arguments.Switches); | ||
|
||
var bimseInstance = (Bimse)invoker.CommandInstance; | ||
|
||
Assert.That(bimseInstance.Switch, Is.EqualTo("value2")); | ||
} | ||
|
||
[Command("bimse")] | ||
class Bimse : ICommand | ||
{ | ||
[Parameter("switch")] | ||
public string Switch { get; set; } | ||
|
||
public void Run() | ||
{ | ||
} | ||
} | ||
} | ||
} |
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