コード例 #1
0
        public void TestNumericOptionsWithArray()
        {
            var options = new NumericOptions
            {
                Prices = new int[] { 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);
        }
コード例 #2
0
        public void TestNumericOptionsWithTooGreatValue()
        {
            var options = new NumericOptions
            {
                Money = 100000
            };

            var s = OptionsValidator.AnalyzeAssignedOptions(options);

            System.Diagnostics.Debug.WriteLine(s);
            Assert.AreEqual(1, s.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Length);
        }
コード例 #3
0
        public void TestNumericOptionsWithTooGreatValue()
        {
            var options = new NumericOptions();

            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);
        }
コード例 #4
0
        public void TestNumericOptionsWithGoodValue()
        {
            var options = new NumericOptions();

            var parser = new CommandLineParser(options);

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

            System.Diagnostics.Debug.WriteLine(s);
            Assert.IsNull(s);
        }
コード例 #5
0
        public void TestNumericOptionsWithArray()
        {
            var options = new NumericOptions
            {
                Prices = new int[] { 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);
        }