We will extend our example from the previous chapter about base conversion so that we can convert from decimal to hexadecimal and vice versa.
As a user, I want to convert a decimal number to a hexadecimal number.
Scenario 1:
Given a decimal number A
When I convert this number to a hexadecimal number
Then, I get a hexadecimal equivalent B of the original decimal number
Scenario 2:
Given a hexadecimal number X
When I convert this number to a decimal number
Then, I get decimal equivalent Y of the original hexadecimal number
Scenario 3:
Given a decimal number A
When I convert A to hexadecimal to get hexadecimal number B
And I again convert B to decimal number C
Then, A is equal to C
Let's apply some of the knowledge we gained in this chapter, so we can take another step toward reusable and clean test code for our example application. In TDD, test code is equally if not more important than the application code.
Now that we are looking at...