https://github.com/ibrahimgunduz34/code-kata-string-calulator
https://github.com/ibrahimgunduz34/code-kata-string-calulator
code-kata java tdd-java tdd-kata
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/ibrahimgunduz34/code-kata-string-calulator
- Owner: ibrahimgunduz34
- Created: 2019-01-24T19:35:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-24T21:20:00.000Z (over 6 years ago)
- Last Synced: 2025-01-29T09:17:14.931Z (3 months ago)
- Topics: code-kata, java, tdd-java, tdd-kata
- Language: Java
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Code Kata
## String Calculator[](https://travis-ci.org/ibrahimgunduz34/code-kata-string-calulator)
The repository was created with inspired the following site.
[http://osherove.com/tdd-kata-1/](http://osherove.com/tdd-kata-1/)### Rules:
DONE:
* Empty string input must returns 0
* Single value input must return itself.
* Comma separated values input must return sum of them.
* New line char separated values input must return sum of them.
* An input like the following which consist of comma separated multiple values, single value and delimited by new lines must return sum.
```$xslt
1
2,3
4,5,6
7
8
9,10,11
```
* Any line can not finalize with comma.
* Each values must be integer. Otherwise it must throw **IllegalArgumentException**
* Negative values must throw **IllegalArgumentException**
* The values greater than 1000 must be ignored
TODO:
* A single char custom delimiter can be defined in the first line like the following:```$xslt
//#
1#2
3
4#5#6
```* Group of chars must be able to use as delimiter
```$xslt
//[##]
1##2
3
4##5##6
```* The input feed can contain multiple custom delimiter/values series. In each iteration, the definition must fallow the rules in the above.