Skip to content

RomanFigure.Spec.Castings

Daniel Gonzalez Garcia edited this page May 5, 2017 · 2 revisions

Story: explicit casting

As a library user
I want to be able to explicitely cast a roman figure
So that I can extract information of individual figures

character of a figure

Given the roman figure N
When is casted to char
Then the character is N

Tags: RomanFigure, Castings

character of a figure

Given the roman figure X
When is casted to char
Then the character is X

Tags: RomanFigure, Castings

character of null

Given the roman figure 'null'
When is casted to char
Then throws argument exception

Tags: RomanFigure, Castings

number of a figure

Given the roman figure N
When is casted to number
Then the number is 0

Tags: RomanFigure, Castings

number of a figure

Given the roman figure X
When is casted to number
Then the number is 10

Tags: RomanFigure, Castings

number of null

Given the roman figure 'null'
When is casted to string
Then the string is 'null'

Tags: RomanFigure, Castings

number of null

Given the roman figure 'null'
When is casted to number
Then throws argument exception

Tags: RomanFigure, Castings

string of a figure

Given the roman figure N
When is casted to string
Then the string is N

Tags: RomanFigure, Castings

string of a figure

Given the roman figure X
When is casted to string
Then the string is X

Tags: RomanFigure, Castings

Clone this wiki locally