Пример #1
0
        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);
        }
Пример #2
0
 public static void NumbersWithZero()
 {
     Assert.AreEqual(2380, StringCalculatorKata.AddStrings("0, 51, 2256, 0, 13, 60"));
 }
Пример #3
0
 public static void NegativeNumbers()
 {
     Assert.AreEqual(-2251, StringCalculatorKata.AddStrings("-47, 7, -55, -2156"));
 }
Пример #4
0
 public static void LargeNumber()
 {
     Assert.AreEqual(123927, StringCalculatorKata.AddStrings("111, 20, 20, 20, 300, 123456"));
 }
Пример #5
0
 public static void Over100()
 {
     Assert.AreEqual(431, StringCalculatorKata.AddStrings("111, 20, 300"));
 }
Пример #6
0
 public static void LessThan20()
 {
     Assert.AreEqual(20, StringCalculatorKata.AddStrings("1, 2, 4, 13"));
 }
Пример #7
0
 public void Init()
 {
     _stringCalculatorKata = new StringCalculatorKata();
 }
Пример #8
0
        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();
 }
Пример #16
0
 public static void NumbersWithZeroAndNegatives()
 {
     Assert.AreEqual(-196, StringCalculatorKata.AddStrings("-123, 0, 0, -13, -60"));
 }
Пример #17
0
 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);
        }