Ejemplo n.º 1
0
        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.");
        }
Ejemplo n.º 2
0
 /// <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)
 {
 }
Ejemplo n.º 3
0
        public void NumberStyles_Initially_ShouldReturnAny()
        {
            var parser = new DecimalOptionParser(typeof(DataTypesCommandOptions).GetProperty("Decimal"), "decimal");

            parser.NumberStyles.Should().Be(NumberStyles.Any);
        }
Ejemplo n.º 4
0
        public void IsOptionRequired_Initially_ShouldReturnFalse()
        {
            var parser = new DecimalOptionParser(typeof(DataTypesCommandOptions).GetProperty("Decimal"), "decimal");

            parser.IsOptionRequired.Should().BeFalse();
        }
Ejemplo n.º 5
0
        public void FormatProvider_Initially_ShouldReturnValueOfCurrentCulture()
        {
            var parser = new DecimalOptionParser(typeof(DataTypesCommandOptions).GetProperty("Decimal"), "decimal");

            parser.FormatProvider.Should().Be(new CultureInfo("en-US"));
        }
Ejemplo n.º 6
0
        public void OptionDefaultValue_Initially_ShouldReturnDefaultOfDecimal()
        {
            var parser = new DecimalOptionParser(typeof(DataTypesCommandOptions).GetProperty("Decimal"), "decimal");

            parser.OptionDefaultValue.Should().Be(default);