Created
September 9, 2012 17:30
-
-
Save phatboyg/3685905 to your computer and use it in GitHub Desktop.
Extensible Command Line Arguments for Topshelf
This file contains hidden or 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
[Test] | |
public void Extensible_the_command_line_should_be_yes() | |
{ | |
bool isSuperfly = false; | |
Host host = HostFactory.New(x => | |
{ | |
x.Service<MyService>(); | |
x.AddCommandLineSwitch("superfly", v => isSuperfly = v); | |
x.ApplyCommandLine("--superfly"); | |
}); | |
Assert.IsTrue(isSuperfly); | |
} | |
[Test] | |
public void Extensible_the_command_line_should_be_yet_again() | |
{ | |
string volumeLevel = null; | |
Host host = HostFactory.New(x => | |
{ | |
x.Service<MyService>(); | |
x.AddCommandLineDefinition("volumeLevel", v => volumeLevel = v); | |
x.ApplyCommandLine("-volumeLevel:11"); | |
}); | |
Assert.AreEqual("11", volumeLevel); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment