Exemplo n.º 1
0
 public void MaxValueItems_ReturnIntMaxVal()
 {
     int[] sourceArray = new int[5] {
         3, 4565, int.MaxValue, 654, 12
     };
     Assert.AreEqual(int.MaxValue, ArrayExt.MaxValueItems(sourceArray));
 }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
 public int MaxValueItems_Test(int[] array) => ArrayExt.MaxValueItems(array);
Exemplo n.º 4
0
 public void MaxValueItems_Empty_ArgumentException()
 {
     int[] sourceArray = new int[0];
     Assert.Throws <ArgumentException>(() => ArrayExt.MaxValueItems(sourceArray));
 }
Exemplo n.º 5
0
 public void MaxValueItems_Length10001_ArgumentOutOfRangeException()
 {
     int[] sourceArray = new int[10001];
     Assert.Throws <ArgumentOutOfRangeException>(() => ArrayExt.MaxValueItems(sourceArray));
 }
Exemplo n.º 6
0
 public void MaxValueItems_Null_ArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => ArrayExt.MaxValueItems(null));
 }