Esempio n. 1
0
        public void can_set_nullable_default_values()
        {
            var args = NativeMethods.CommandLineToArgs("-s 100");
            var simple = new CommandLineArgs();
            var result = simple.CliParse(args);

            Assert.AreEqual(true, result.Successful);
            Assert.AreEqual(0, result.CliParseMessages.ToList().Count);
            Assert.AreEqual(false, result.ShowHelp);
            Assert.AreEqual(100, simple.Seed);
        }
Esempio n. 2
0
        public void can_set_implied_defaulted_values()
        {
            var args = NativeMethods.CommandLineToArgs("100");
            var simple = new CommandLineArgs();
            var result = simple.CliParse(args);

            Assert.AreEqual(true, result.Successful,"Successful");
            Assert.AreEqual(0, result.CliParseMessages.ToList().Count);
            Assert.AreEqual(false, result.ShowHelp);
            Assert.AreEqual(100, simple.ImpliedDefault);
        }
Esempio n. 3
0
        public void can_generate_info_text_from_parsable_attributes_advanced()
        {
            var simple = new CommandLineArgs();

            var expected = @"TDG 

Description:
    Test Data Generation tool    

Syntax:
The following argument prefix characters can be used: '-','/'
    --template, -t    
        The template containing 1 or more patterns to use when producing data.
        [Optional], Default:''
        
    --pattern, -p    
        The pattern to use when producing data.
        [Optional], Default:''
        
    --detailed, -d    
        Show help text for pattern symbols
        [Optional], Default:'False'
        
    --inputfile, -i    
        The path of the input file.
        [Optional], Default:''
        
    --output, -o    
        The path of the output file.
        [Optional], Default:''
        
    --count, -c    
        The number of items to produce.
        [Optional], Default:'1'
        
    --seed, -s    
        The seed value for random generation. Default is a random value.
        [Optional], Default:''
        
    --verbose, -v    
        Verbose output including debug and performance information.
        [Optional], Default:'False'
        
    --namedpatterns, -n    
        A list of ';' seperated file paths containing named patterns to 
        be used in addition to default.tdg-patterns.
        [Optional], Default:''
        
    --listnamedpatterns, -l    
        Outputs a list of the named patterns from the 
        default.tdg-patterns file.
        [Optional], Default:'False'
        
    --impliedDefault,     
        Implied first position. Default is 1
        [Optional], Default:'1'
";

            var actual = simple.GetUsage();
            Assert.AreEqual(expected, actual);
        }