public PartialViewResult MinAndMax(string values)
 {
     try
     {
         var input  = ConvertStringToIntArray(values);
         var result = _basicAlgorithms.MinAndMax(input);
         return(PartialView(
                    "_Results",
                    new ResultsViewModel
         {
             Success = true,
             Result = string.Format("minimum {0}, maksimum {1}", result.Item1, result.Item2)
         }));
     }
     catch (Exception)
     {
         return(PartialView("_Results", new ResultsViewModel {
             Success = false
         }));
     }
 }
Beispiel #2
0
        public void MinAndMax_OneElement_MinEqualsMax()
        {
            var result = _basicAlgorithms.MinAndMax(new int[] { 1 });

            Assert.AreEqual((Min: 1, Max: 1), result);
        }