Exemple #1
0
        public void TestDecimalOptionsWithArray()
        {
            var options = new DecimalOptions
            {
                Prices = new decimal[] { 5, 100, 300, 5000, 100000 }
            };

            var s = OptionsValidator.AnalyzeAssignedOptions(options);

            System.Diagnostics.Debug.WriteLine(s);
            Assert.AreEqual(2, s.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Length);
        }
Exemple #2
0
        public void TestDecimalOptionsWithTooGreatValue()
        {
            var options = new DecimalOptions
            {
                Money = 100000
            };

            var s = OptionsValidator.AnalyzeAssignedOptions(options);

            System.Diagnostics.Debug.WriteLine(s);
            Assert.AreEqual(1, s.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Length);
        }
Exemple #3
0
        public void TestDecimalOptionsWithTooGreatValue()
        {
            var options = new DecimalOptions();

            var parser = new CommandLineParser(options);

            parser.Parse("/Money:100000", false);
            var s = parser.ErrorMessage;

            System.Diagnostics.Debug.WriteLine(s);
            Assert.AreEqual(1, s.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Length);
        }
Exemple #4
0
        public void TestDecimalOptionsWithArray()
        {
            var options = new DecimalOptions
            {
                Prices = new decimal[] { 5, 100, 300, 5000, 100000 }
            };

            var parser = new CommandLineParser(options);

            parser.Parse("/Prices:5 100 300 5000 100000", false);
            var s = parser.ErrorMessage;

            System.Diagnostics.Debug.WriteLine(s);
            Assert.AreEqual(2, s.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Length);
        }