public void SumOfMins_TestConsistency() { //arrange int[] tarr = { 4, 0, 3, 19, 492, -10, 1 }; int expectedSum = -10; //act int actual = Byndyusoft.GetSumOfMins(ref tarr); //assert Assert.AreEqual(expectedSum, actual); }
static void Main(string[] args) { // int[] arr = {2147483647, 99999}; int[] arr = null; try { int sum = Byndyusoft.GetSumOfMins(ref arr); } catch (Exception ex) { Console.WriteLine(ex.Message); throw; } Console.ReadKey(); }
public void SumOfMins_TestIntOverflow() { //arrange int[] tarr = { 2147483647, 99999 }; Assert.ThrowsException <System.OverflowException>(() => Byndyusoft.GetSumOfMins(ref tarr)); }
public void SumOfMins_TestNull() { int[] arr = null; Assert.ThrowsException <ArgumentException>(() => Byndyusoft.GetSumOfMins(ref arr)); }