Average of an array will fail if I have int.MaxValue in the array
<p>I have defined the following method which calculates the average of an array:</p>

<pre><code>public int AverageOfArray (params int[] arr)
        {
            if (arr.Length &gt; 0)
            {
                double avg = Sum(ints) / arr.Length;
                return (int)avg;
            }
            return 0;
        }
</code></pre>

<p>My requirement is that the average should be returned as an integer. When I tried to test this method using the int.MaxValue        The unit test will fail. How can I make the test class pass?</p>

<p>UPDATED::-</p>

<pre><code>public int Sum(params int[] arr)
        {
            int total = 0;

            for (int n = 0; n &lt; arr.Length; n++)
            {
                total += arr[n];
            }

            return total;


        }
</code></pre>
