public void ArgumentsAreInterpolatedWell() { var timespanArg = new SampleTimeSpanArgument(TimeSpan.FromSeconds(5)); var switchArg = new SampleSwitchArgument(true); var stringArg = new SampleStringArgument(); stringArg.Action("string-value"); Assert.Equal("time is 00:00:05", $"time is {timespanArg}"); Assert.Equal("switch is true", $"switch is {switchArg}"); Assert.Equal("string is string-value", $"string is {stringArg}"); }
public void SwitchArgumentArgumentWithDefaultValueIsFalse() { var arg = new SampleSwitchArgument(true); var command = UnitTestCommand.FromArgument(arg); var exitCode = command.Invoke(new[] { "-b=off", }); Assert.Equal(0, exitCode); Assert.True(command.CommandRun); Assert.False(arg.Value); }