RomanFigure equality operators

Value equality can be checked against other instances of RomanFigure:

Story is equality to roman figure
  In order to say that a figure is equal to another figure
  As a library user
  I want to use the equality operator against a roman figure

      With scenario a roman figure is compared against the same roman figure
        Given the roman figure V
        When equal to V
        Then is True

      With scenario a roman figure is compared against not the same roman figure
        Given the roman figure V
        When equal to X
        Then is False

      With scenario a roman figure is compared against null
        Given the roman figure V
        When equal to {NULL}
        Then is False

      With scenario null is compared against a roman figure
        Given the roman figure {NULL}
        When equal to X
        Then is False

      With scenario null is compared against null
        Given the roman figure {NULL}
        When equal to {NULL}
        Then is True


Story is inequality to roman figure
  In order to say that a figure is not equal to another figure
  As a library user
  I want to use the inequality operator against a roman figure

      With scenario a roman figure is compared against the same roman figure
        Given the roman figure V
        When not equal to V
        Then is False

      With scenario a roman figure is compared against not the same roman figure
        Given the roman figure V
        When not equal to X
        Then is True

      With scenario a roman figure is compared against null
        Given the roman figure V
        When not equal to {NULL}
        Then is True

      With scenario null is compared against a roman figure
        Given the roman figure {NULL}
        When not equal to X
        Then is True

      With scenario null is compared against null
        Given the roman figure {NULL}
        When not equal to {NULL}
        Then is False


Also against short numbers:

Story is equality to number
  In order to say that a short figure is equal to the value of a roman figure
  As a library user
  I want to use the equality operator against a roman figure

      With scenario a short figure is compared against the same value of a roman figure
        Given the roman figure 5
        When equal to V
        Then is True

      With scenario a short figure is compared against not the same value of a roman figure
        Given the roman figure 5
        When equal to X
        Then is False

      With scenario a short figure is compared against null
        Given the roman figure 5
        When equal to {NULL}
        Then is False


Story is inequality to number
  In order to say that a figure is not equal to a short figure
  As a library user
  I want to use the inequality operator against a short figure

      With scenario a roman figure is compared against a short figure with the same value
        Given the roman figure V
        When not equal to 5
        Then is False

      With scenario a roman figure is compared against a short figure not the same value
        Given the roman figure V
        When not equal to 10
        Then is True

      With scenario null is compared against a short value
        Given the roman figure {NULL}
        When not equal to 10
        Then is True


Story is equality to number
  In order to say that a number is equal to a roman figure
  As a library user
  I want to use the equality operator against a roman figure

      With scenario a short figure is compared against the same value of a roman figure
        Given the roman figure 5
        When equal to V
        Then is True

      With scenario a short figure is compared against not the same value of a roman figure
        Given the roman figure 5
        When equal to X
        Then is False

      With scenario a short figure is compared against null
        Given the roman figure 5
        When equal to {NULL}
        Then is False


Story is equality to number
  In order to say that a number is equal to a roman figure
  As a library user
  I want to use the equality operator against a roman figure

      With scenario a short figure is compared against the same value of a roman figure
        Given the roman figure 5
        When equal to V
        Then is True

      With scenario a short figure is compared against not the same value of a roman figure
        Given the roman figure 5
        When equal to X
        Then is False

      With scenario a short figure is compared against null
        Given the roman figure 5
        When equal to {NULL}
        Then is False


Story is inequality to number
  In order to say that a number is not equal to a roman figure
  As a library user
  I want to use the inequality operator against a roman figure

      With scenario a short figure is compared against the same value of a roman figure
        Given the roman figure 5
        When not equal to V
        Then is False

      With scenario a short figure is compared against not the same value of a roman figure
        Given the roman figure 5
        When not equal to X
        Then is True

      With scenario a short figure is compared against null
        Given the roman figure 5
        When not equal to {NULL}
        Then is True

And against char characters:
Story is equality to char
  In order to say that a figure is equal to a char figure
  As a library user
  I want to use the equality operator against a char figure

      With scenario a roman figure is compared against the same figure as a char figure
        Given the roman figure V
        When equal to V
        Then is True

      With scenario a roman figure is compared against not the same figure as a char figure
        Given the roman figure V
        When equal to X
        Then is False

      With scenario null is compared against a char figure
        Given the roman figure {NULL}
        When equal to X
        Then is False

      With scenario a roman figure is compared against the same figure as a lowercase char figure
        Given the roman figure V
        When equal to v
        Then is False


Story is inequality to char
  In order to say that a figure is not equal to a char figure
  As a library user
  I want to use the inequality operator against a char figure

      With scenario a roman figure is compared against the same figure as a char figure
        Given the roman figure V
        When not equal to V
        Then is False

      With scenario a roman figure is compared against not the same roman figure
        Given the roman figure V
        When not equal to X
        Then is True

      With scenario null is compared against a roman figure
        Given the roman figure {NULL}
        When not equal to X
        Then is True

      With scenario a roman figure is compared against the same figure as a lowercase char figure
        Given the roman figure V
        When not equal to v
        Then is True


Story is equality to char
  In order to say that a char is equal to a roman figure
  As a library user
  I want to use the equality operator against a roman figure

      With scenario a char figure is compared against a roman figure with the same figure
        Given the roman figure V
        When equal to V
        Then is True

      With scenario a roman figure is compared against a roman figure not with the same figure
        Given the roman figure V
        When equal to X
        Then is False

      With scenario a char figure is compared against null
        Given the roman figure V
        When equal to {NULL}
        Then is False

      With scenario a lowercase char figure is compared against a roman figure with the same figure
        Given the roman figure v
        When equal to V
        Then is False


Story is inequality to char
  In order to say that a char figure is not equal to a roman figure
  As a library user
  I want to use the inequality operator against a roman figure

      With scenario a char figure is compared against a roman figure with the same figure
        Given the roman figure V
        When not equal to V
        Then is False

      With scenario a char figure is compared against a roman figure not with the same figure
        Given the roman figure V
        When not equal to X
        Then is True

      With scenario a char figure is compared against null
        Given the roman figure V
        When not equal to {NULL}
        Then is True

      With scenario a lowercase char figure is compared against a roman figure with the same figure
        Given the roman figure v
        When not equal to V
        Then is True

Last edited Jan 3, 2012 at 10:02 PM by dgon, version 1

Comments

No comments yet.