Roman Numerals: First Test

Let's practice how to write tests for an existent function.

Practice

Now that we’ve covered the basics of tests in Go, let’s see a practical example in which we’re going to add tests and refactor them. The exercise we’ll rely on is the Roman Numerals Converter kata.

Roman numeral conversion

This is by far one of the most popular katas available. However, let’s refresh its rules for the purposes of this lesson. The Roman symbols that we can use to represent numbers are summarized in the following table:

Get hands-on with 1400+ tech skills courses.