public void Exists_ShouldBeFalse_WhenEmptyArgs() { var option = new CommandLineOption("zero", new string[0]); var result = option.Exists(); result.Should().BeFalse(); }
public void Exists_ShouldBeTrue_WhenOptionInArgs_PrecededWithDoubleMinus() { var args = new[] { "one", "-two", "--three", "--zero" }; var option = new CommandLineOption("zero", args); var result = option.Exists(); result.Should().BeTrue(); }
public void Exists_ShouldBeFalse_WhenNoOptionInArgs() { var args = new [] { "zero", "one", "-two", "--three", "--h", "z", "-z", "--z", "0", "\"day.com\"" }; var option = new CommandLineOption("zero", args); var result = option.Exists(); result.Should().BeFalse(); }
private static void HandleIntentionalCrash(Application app, string[] args) { var option = new CommandLineOption("crash", args); if (!option.Exists()) { return; } app.Deactivated += (sender, ea) => throw new StackOverflowException("Intentional crash test"); }