public void TestValidateShouldIgnoreLargeNumbers(int largestNumber, long[] numbers, long expectedResult) { var math = new Calc.Math(optionsProvider.MockOptions(largestNumber: largestNumber)); var actualResult = math.Add(numbers); Assert.Equal(expectedResult, actualResult); }
public void TestAdd(long expectedResult, long[] values) { var math = new Calc.Math(optionsProvider.MockOptions()); long actualResult = math.Add(values); Assert.Equal(expectedResult, actualResult); }
public void TestShouldDenyNegativeNumbers(string s, long[] numbers, long[] expectedErrors) { var math = new Calc.Math(optionsProvider.MockOptions(shouldDenyNegative: true)); var exception = Record.Exception(() => math.Add(numbers)); Assert.IsType <NegativeNumbersException>(exception); Assert.Equal(expectedErrors, ((NegativeNumbersException)exception).NegativeNumbers); }