public void MaxValueItems_ReturnIntMaxVal()
 {
     int[] sourceArray = new int[5] {
         3, 4565, int.MaxValue, 654, 12
     };
     Assert.AreEqual(int.MaxValue, ArrayExt.MaxValueItems(sourceArray));
 }
Exemple #2
0
        public static void Main(string[] args)
        {
            var arr2 = new[] { 7, 1, 2, 3, 4, 5, 6, 7, 68, 69, 70, 15, 17 };

            int[]  arr = new int[10];
            Random rnd = new Random();

            for (int i = 0; i < arr.Length; i++)
            {
                arr[i] = rnd.Next(-100000, 100000);
            }

            Console.WriteLine($"max item {ArrayExt.MaxValueItems(arr)}");
            Console.WriteLine();

            Console.ReadKey();
        }
 public int MaxValueItems_Test(int[] array) => ArrayExt.MaxValueItems(array);
 public void MaxValueItems_Empty_ArgumentException()
 {
     int[] sourceArray = new int[0];
     Assert.Throws <ArgumentException>(() => ArrayExt.MaxValueItems(sourceArray));
 }
 public void MaxValueItems_Length10001_ArgumentOutOfRangeException()
 {
     int[] sourceArray = new int[10001];
     Assert.Throws <ArgumentOutOfRangeException>(() => ArrayExt.MaxValueItems(sourceArray));
 }
 public void MaxValueItems_Null_ArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => ArrayExt.MaxValueItems(null));
 }