Conversion of Roman Figures

Instances can be converted using standard conversion methods:

Story is ChangeType
  In order to convert a roman figure to a clr type whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario supported type
        Given the roman figure M                                     => Passed
        When converted to System.Int64                               => Passed
        Then is 1000                                                 => Passed

      With scenario overflowing type
        Given the roman figure M                                     => Passed
        When converted to System.Byte                                => Passed
        Then overflows                                               => Passed

      With scenario unsupported type
        Given the roman figure M                                     => Passed
        When converted to System.TimeSpan                            => Passed
        Then cannot cast                                             => Passed

      With scenario unsupported type
        Given the roman figure M                                     => Passed
        When converted to System.Exception                           => Passed
        Then cannot cast                                             => Passed

      With scenario itself
        Given the roman figure M                                     => Passed
        When converted to SharpRomans.RomanFigure                    => Passed
        Then is M                                                    => Passed

Story is convert to Boolean
  In order to convert a roman figure to boolean whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                  => Passed
        When converted to boolean                                 => Passed
        Then is False                                             => Passed

      With scenario one
        Given the roman figure I                                  => Passed
        When converted to boolean                                 => Passed
        Then is True                                              => Passed

      With scenario more than one
        Given the roman figure D                                  => Passed
        When converted to boolean                                 => Passed
        Then is True                                              => Passed

      With scenario max
        Given the roman figure M                                  => Passed
        When converted to boolean                                 => Passed
        Then is True                                              => Passed

Story is convert to Byte
  In order to convert a roman figure to a byte whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                 => Passed
        When converted to byte                                   => Passed
        Then is 0                                                => Passed

      With scenario less than max
        Given the roman figure C                                 => Passed
        When converted to byte                                   => Passed
        Then is 100                                              => Passed

      With scenario max
        Given the roman figure M                                 => Passed
        When converted to byte                                   => Passed
        Then overflows                                           => Passed

Story is convert to Char
  In order to convert a roman figure to a char whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                 => Passed
        When converted to char                                   => Passed
        Then is N                                                => Passed

      With scenario more than one
        Given the roman figure D                                 => Passed
        When converted to char                                   => Passed
        Then is D                                                => Passed

      With scenario max
        Given the roman figure M                                 => Passed
        When converted to char                                   => Passed
        Then is M                                                => Passed

Story is convert to DateTime
  In order to convert a roman figure to date-time whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                    => Passed
        When converted to date time                                 => Passed
        Then cannot cast                                            => Passed

      With scenario less than max
        Given the roman figure C                                    => Passed
        When converted to date time                                 => Passed
        Then cannot cast                                            => Passed

      With scenario max
        Given the roman figure M                                    => Passed
        When converted to date time                                 => Passed
        Then cannot cast                                            => Passed

Story is convert to Decimal
  In order to convert a roman figure to a decimal whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                    => Passed
        When converted to decimal                                   => Passed
        Then is 0                                                   => Passed

      With scenario less than max
        Given the roman figure C                                    => Passed
        When converted to decimal                                   => Passed
        Then is 100                                                 => Passed

      With scenario max
        Given the roman figure M                                    => Passed
        When converted to decimal                                   => Passed
        Then is 1000                                                => Passed

Story is convert to Double
  In order to convert a roman figure to a double whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                   => Passed
        When converted to double                                   => Passed
        Then is 0                                                  => Passed

      With scenario less than max
        Given the roman figure C                                   => Passed
        When converted to double                                   => Passed
        Then is 100                                                => Passed

      With scenario max
        Given the roman figure M                                   => Passed
        When converted to double                                   => Passed
        Then is 1000                                               => Passed

Story is convert to Float
  In order to convert a roman figure to a float whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                  => Passed
        When converted to float                                   => Passed
        Then is 0                                                 => Passed

      With scenario less than max
        Given the roman figure C                                  => Passed
        When converted to float                                   => Passed
        Then is 100                                               => Passed

      With scenario max
        Given the roman figure M                                  => Passed
        When converted to float                                   => Passed
        Then is 1000                                              => Passed

Story is convert to Int
  In order to convert a roman figure to an int whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                 => Passed
        When converted to int                                    => Passed
        Then is 0                                                => Passed

      With scenario less than max
        Given the roman figure C                                 => Passed
        When converted to int                                    => Passed
        Then is 100                                              => Passed

      With scenario max
        Given the roman figure M                                 => Passed
        When converted to int                                    => Passed
        Then is 1000                                             => Passed

Story is convert to Long
  In order to convert a roman figure to a long whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                 => Passed
        When converted to long                                   => Passed
        Then is 0                                                => Passed

      With scenario less than max
        Given the roman figure C                                 => Passed
        When converted to long                                   => Passed
        Then is 100                                              => Passed

      With scenario max
        Given the roman figure M                                 => Passed
        When converted to long                                   => Passed
        Then is 1000                                             => Passed

Story is convert to SByte
  In order to convert a roman figure to a signed byte whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                        => Passed
        When converted to s byte                                        => Passed
        Then is 0                                                       => Passed

      With scenario less than max
        Given the roman figure C                                        => Passed
        When converted to s byte                                        => Passed
        Then is 100                                                     => Passed

      With scenario max
        Given the roman figure M                                        => Passed
        When converted to s byte                                        => Passed
        Then overflows                                                  => Passed

Story is convert to short
  In order to convert a roman figure to a short whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                  => Passed
        When converted to short                                   => Passed
        Then is 0                                                 => Passed

      With scenario less than max
        Given the roman figure C                                  => Passed
        When converted to short                                   => Passed
        Then is 100                                               => Passed

      With scenario max
        Given the roman figure M                                  => Passed
        When converted to short                                   => Passed
        Then is 1000                                              => Passed

Story is convert to UInt
  In order to convert a roman figure to an unsigned int whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                          => Passed
        When converted to u int                                           => Passed
        Then is 0                                                         => Passed

      With scenario less than max
        Given the roman figure C                                          => Passed
        When converted to u int                                           => Passed
        Then is 100                                                       => Passed

      With scenario max
        Given the roman figure M                                          => Passed
        When converted to u int                                           => Passed
        Then is 1000                                                      => Passed

Story is convert to ULong
  In order to convert a roman figure to an unsigned long whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                           => Passed
        When converted to u long                                           => Passed
        Then is 0                                                          => Passed

      With scenario less than max
        Given the roman figure C                                           => Passed
        When converted to u long                                           => Passed
        Then is 100                                                        => Passed

      With scenario max
        Given the roman figure M                                           => Passed
        When converted to u long                                           => Passed
        Then is 1000                                                       => Passed

Story is convert to UShort
  In order to convert a roman figure to an unsigned short whenever possible
  As a library user
  I want Convert() to a roman figure

      With scenario zero
        Given the roman figure N                                            => Passed
        When converted to u short                                           => Passed
        Then is 0                                                           => Passed

      With scenario less than max
        Given the roman figure C                                            => Passed
        When converted to u short                                           => Passed
        Then is 100                                                         => Passed

      With scenario max
        Given the roman figure M                                            => Passed
        When converted to u short                                           => Passed
        Then is 1000                                                        => Passed

Last edited Jan 3, 2012 at 8:45 PM by dgon, version 1

Comments

No comments yet.