public void Calculate_NegativeNumbers_TrowsArgumentExceptionWithMessage(string input) { var exception = Record.Exception(() => StringCalculatorKata.Calculate(input)); Assert.Equal("Negative numbers not supported\r\nParameter name: input", exception.Message); //Assert.Equal("Negative numbers not supported", exception.Message); }
public static void NumbersWithZero() { Assert.AreEqual(2380, StringCalculatorKata.AddStrings("0, 51, 2256, 0, 13, 60")); }
public static void NegativeNumbers() { Assert.AreEqual(-2251, StringCalculatorKata.AddStrings("-47, 7, -55, -2156")); }
public static void LargeNumber() { Assert.AreEqual(123927, StringCalculatorKata.AddStrings("111, 20, 20, 20, 300, 123456")); }
public static void Over100() { Assert.AreEqual(431, StringCalculatorKata.AddStrings("111, 20, 300")); }
public static void LessThan20() { Assert.AreEqual(20, StringCalculatorKata.AddStrings("1, 2, 4, 13")); }
public void Init() { _stringCalculatorKata = new StringCalculatorKata(); }
static void StringCalculator() { var ret = StringCalculatorKata.Add("1\n2,-3"); Console.WriteLine(ret); }
public void Calculate_WhiteSpace_ThrowsException() { Action act = () => StringCalculatorKata.Calculate(" "); Assert.Throws <ArgumentException>("input", act); }
public void Calculate_NegativeNumbers_TrowsArgumentException(string input) { Action act = () => StringCalculatorKata.Calculate(input); Assert.Throws <ArgumentException>("input", act); }
public void Calculate_MultipleNumbers_WithDifferentSeparators_ReturnsSumOfNumbers(string input, double expected) { var actual = StringCalculatorKata.Calculate(input); Assert.Equal(expected, actual); }
public void Calculate_TwoNumbers_ReturnsSumOfNumbers(string input, double expected) { var actual = StringCalculatorKata.Calculate(input); Assert.Equal(expected, actual); }
public void Calculate_SingleNumber_ReturnsSingleNumber(string input, double expected) { var actual = StringCalculatorKata.Calculate(input); Assert.Equal(expected, actual); }
public void Calculate_NullString_ThrowsException() { Action act = () => StringCalculatorKata.Calculate(default(string)); Assert.Throws <ArgumentNullException>("input", act); }
private void w_fenster_Loaded(object sender, RoutedEventArgs e) { sck = new StringCalculatorKata(); }
public static void NumbersWithZeroAndNegatives() { Assert.AreEqual(-196, StringCalculatorKata.AddStrings("-123, 0, 0, -13, -60")); }
public static void LessThan10() { Assert.AreEqual(5, StringCalculatorKata.AddStrings("2, 3")); }
public void Calculate_EmptyString_ThrowsException() { Action act = () => StringCalculatorKata.Calculate(string.Empty); Assert.Throws <ArgumentException>("input", act); }