public void GetHelpText_ShouldReturnSpecifiedHelpText() { var parser = new DecimalOptionParser(typeof(DataTypesCommandOptions).GetProperty("Decimal"), "decimal"); parser.OptionHelp = "Help text for option decimal."; parser.GetHelpText().Should().Be("Help text for option decimal."); }
/// <summary> /// Initializes a new instance of this class. /// </summary> /// <param name="commandParser">The parser for the command the option belongs to.</param> /// <param name="optionParser">The parser for the option.</param> /// <exception cref="ArgumentNullException"><paramref name="commandParser" /> is null.</exception> /// <exception cref="ArgumentNullException"><paramref name="optionParser" /> is null.</exception> public DecimalOptionSetup(CommandParser <TCommandOptions> commandParser, DecimalOptionParser optionParser) : base(commandParser, optionParser) { }
public void NumberStyles_Initially_ShouldReturnAny() { var parser = new DecimalOptionParser(typeof(DataTypesCommandOptions).GetProperty("Decimal"), "decimal"); parser.NumberStyles.Should().Be(NumberStyles.Any); }
public void IsOptionRequired_Initially_ShouldReturnFalse() { var parser = new DecimalOptionParser(typeof(DataTypesCommandOptions).GetProperty("Decimal"), "decimal"); parser.IsOptionRequired.Should().BeFalse(); }
public void FormatProvider_Initially_ShouldReturnValueOfCurrentCulture() { var parser = new DecimalOptionParser(typeof(DataTypesCommandOptions).GetProperty("Decimal"), "decimal"); parser.FormatProvider.Should().Be(new CultureInfo("en-US")); }
public void OptionDefaultValue_Initially_ShouldReturnDefaultOfDecimal() { var parser = new DecimalOptionParser(typeof(DataTypesCommandOptions).GetProperty("Decimal"), "decimal"); parser.OptionDefaultValue.Should().Be(default);