public void ComputeSum_ForNonSquareSizes_Throws(int size) { var values = new int[size]; for (int i = 0; i < size; ++i) { values[i] = i + 1; } Assert.Throws <ArgumentException>(() => MagicSquares.ComputeSum(values)); }
public void ComputeSum_ForStandardValues_Works(int size, int expectedSum) { var values = new int[size]; for (int i = 0; i < size; ++i) { values[i] = i + 1; } Assert.Equal(expectedSum, MagicSquares.ComputeSum(values)); }