Beispiel #1
0
        public void ParseRangeToListOfInteger_With_Negative_Numbers_Throws_ArgumentException()
        {
            var ex = Assert.Throws <ArgumentException>(() =>
            {
                ListLibrary.ParseRangeToListOfInteger("-4-11");
            });

            Assert.That(ex.Message, Is.EqualTo("Negative values are not supported."));
        }
Beispiel #2
0
        public string ParseRangeToListOfInteger(string rangeString)
        {
            IEnumerable <int> listFromRange = ListLibrary.ParseRangeToListOfInteger(rangeString);

            string output = "";

            foreach (int item in listFromRange)
            {
                output += item + ", ";
            }
            output = output.Trim();
            return(output);
        }