Created
November 1, 2013 15:03
-
-
Save hanson-andrew/7266770 to your computer and use it in GitHub Desktop.
My attempt at Roy Osherove's TDD Kata 1 ended up with this skeleton
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Math | |
| { | |
| private _parser As IParser; | |
| public Math(IParser parser) | |
| { | |
| this._parser = parser; | |
| } | |
| public int Add(string numbers) | |
| { | |
| IEnumerable<int> numbers = this._parser.ParseNumbers(numbers) | |
| //Add them up and return the value | |
| } | |
| } | |
| public class Parser : IParser | |
| { | |
| public IEnumerable<int> ParseNumbers(string numbers) | |
| { | |
| //Let's assume I do this correctly here | |
| } | |
| } | |
| public interface IParser | |
| { | |
| IEnumerable<int> ParseNumbers(string numbers); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment