October 2013
Intermediate to advanced
368 pages
9h 20m
English
What are we building?
We need a function that takes an Arabic number and returns its Roman numeral equivalent (as a string).
Getting the first test to pass will take us a few minutes, since there’s a good amount of setup work to do (getting the build script in place, adding header includes, and so on). There are also decisions to be made: What are we going to name our test method? What should the interface to our function look like?
We choose to make our conversion a free function. Here’s the first, failing test:
| roman/1/RomanConverterTest.cpp | |
| | TEST(RomanConverter, CanConvertPositiveDigits) { |
| | EXPECT_THAT(convert(1), Eq("I")); |
| | } |
One of the goals for a kata is to minimize our ...