-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTODO.TXT
16 lines (14 loc) · 1.33 KB
/
TODO.TXT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
String Calculator:
[DONE] Create a simple String calculator with a method int Add(string numbers)
[DONE] -The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0) for example ÒÓ or Ò1Ó or Ò1,2Ó
[DONE]-Start with the simplest test case of an empty string and move to 1 and two numbers
[DONE]-Remember to solve things as simply as possible so that you force yourself to write tests you did not think about
[DONE]-Remember to refactor after each passing test
[DONE] Allow the Add method to handle an unknown amount of numbers
[DONE] Allow the Add method to handle new lines between numbers (instead of commas).
[DONE]- the following input is ok: Ò1\n2,3Ó (will equal 6)
[DONE]- the following input is NOT ok: Ò1,\nÓ (not need to prove it - just clarifying)
[DONE] Support different delimiters
[DONE] - to change a delimiter, the beginning of the string will contain a separate line that looks like this: Ò//[delimiter]\n[numbersÉ]Ó for example Ò//;\n1;2Ó should return three where the default delimiter is Ô;Õ .
- the first line is optional. all existing scenarios should still be supported
Calling Add with a negative number will throw an exception Ònegatives not allowedÓ - and the negative that was passed.if there are multiple negatives, show all of them in the exception message