예제 #1
0
        public void ArraySum_ReturnsSumOfArray_IfArrayValid(long[] inputArray, long sumValue)
        {
            var result = ArraySumFunctions.ArraySum(inputArray);

            Assert.AreEqual(sumValue, result);
        }
예제 #2
0
        public void ArraySum_ThrowsNullException_IfArrayIsNull()
        {
            long[] testArray = null;

            Assert.That(() => ArraySumFunctions.ArraySum(testArray), Throws.ArgumentNullException);
        }
예제 #3
0
        public void ArraySum_ThrowsArgumentException_IfArrayIsEmpty()
        {
            long[] testArray = { };

            Assert.That(() => ArraySumFunctions.ArraySum(testArray), Throws.ArgumentException);
        }