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); }
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); }
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); }
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); }
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); }