TDD kata with NUnit and Shouldly. You will need NUnit 3 Test Adapter extension.
- empty or null string returns 0
- comma delimited numbers are added together, i.e.
"1"
returns1
,"1,2"
returns3
, etc... - allow newlines to act as a delimiter, i.e.
"1,2\n10"
returns13
- empty lines or values are treated as zeros, i.e.
"1,,2\n\n\n5"
returns8
- negative numbers and non-integers throw an exception
- support different delimiters, first line declares the delimiter when started with hash:
returns
#| 1|2|10
13
- delimiters can be any length:
returns
#-- 1--7--23 4--4
39