public void SumOfPositive_NegativeOneThroughNegativeFive() { Assert.AreEqual(0, SumOfPositive.PositiveSum(new int[] { -1, -2, -3, -4, -5 })); }
public static void RandomTest([Random(5, 120, 40)] int length) { int[] arr = RandomArray(length); Assert.AreEqual(Solution(arr), SumOfPositive.PositiveSum(arr), string.Format("Failed when arr = {0}", arr)); }
public void SumOfPositive_EmptyArray() { Assert.AreEqual(0, SumOfPositive.PositiveSum(new int[] {})); }
public void SumOfPositive_SumNegative1ThenNegative5() { Assert.AreEqual(9, SumOfPositive.PositiveSum(new int[] { -1, 2, 3, 4, -5 })); }
public void SumOfPositive_Sum1Negative2Through5() { Assert.AreEqual(13, SumOfPositive.PositiveSum(new int[] { 1, -2, 3, 4, 5 })); }
public void SumOfPositive_Sum1Through5() { Assert.AreEqual(15, SumOfPositive.PositiveSum(new int[] { 1, 2, 3, 4, 5 })); }
public static int SumOfPositive_Test(int[] arr) { return(SumOfPositive.PositiveSum(arr)); }