Int can not hold the value of int.MaxValue
<p>I have the following two methods:</p>

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

public int Sum(params int[] array2)
{
    int total = 0;
    for (int n = 0; n &lt; array2.Length; n++)
    {
        total += arr[n];
    }
    return total;
}
</code></pre>

<p>But for testing purposes I tried adding the <code>int.MaxValue / 2</code> and <code>int.MaxValue / 2 + 4.</code> in the array. But why does the unit test fail, although the sum of the two values will be less than <code>int.MaxValue</code>?</p>
