Beispiel #1
0
        public void TestSecondNumber()
        {
            var sut = new SortNumbers();
            IEnumerable <int> numbersToSort = new List <int> {
                14, 22, 3
            };
            var result = sut.SecondSort(numbersToSort);

            Assert.That(result, Is.EqualTo(14));
        }
Beispiel #2
0
        public void TestSecondNumberWithSingleArray()
        {
            var sut = new SortNumbers();
            IEnumerable <int> numbersToSort = new List <int> {
                14
            };
            var result = sut.SecondSort(numbersToSort);

            Assert.That(result, Is.EqualTo(0));
        }
Beispiel #3
0
        public void TestName()
        {
            var sut = new SortNumbers();
            IEnumerable <int> numbersToSort = new List <int> {
                14, 22, 3
            };
            var result      = sut.Sort(numbersToSort);
            var firstNumber = result.ToList().FirstOrDefault();

            Assert.That(firstNumber, Is.EqualTo(3));
        }
Beispiel #4
0
 static void Main(string[] args)
 {
     #region SortNumbers
     var    sortNumbers  = new SortNumbers();
     var    inputConsole = new InputConsole();
     var    convertArray = new ConvertArray();
     string parametr;
     try
     {
         parametr = inputConsole.GetNumberAsString();
     }
     catch (MyExeption ex)
     {
         parametr = inputConsole.GetNumberAsString();
     }
     char[] charArray = convertArray.ToCharArray(parametr);
     int[]  intArray  = convertArray.ToIntArray(charArray);
     string result    = sortNumbers.GetSortNumbers(intArray);
     Console.WriteLine(result);
     #endregion
 }