How to refactor tests in tdd?
问题 I'm performing this TDD kata excercise: http://osherove.com/tdd-kata-1 I produced following code (points from 1 to 5 in this excercise - I have unit tests for it): public class StringCalculator { private readonly string[] _defaultSeparators = { ",", "\n" }; public int Add(string numbers) { // Parser section (string to list of ints) var separators = _defaultSeparators; var isSeparatorDefinitionSpecified = numbers.StartsWith("//"); if (isSeparatorDefinitionSpecified) { var