Some acceptance tests for magic system

I read my description of what kind of spell system I would like to have in Herculeum and wrote some high level tests based on it. Not all requirements are captured by these, for example gaining mana is missing. But these should be plenty to get me started with the programming tasks. After these tests are passing, I have probably learned a bit more about the magic system and can continue with more tests.

Feature: Magic
  as an spell caster
  in order to survive my adventure
  I want to use spells

  Background:
     Given Simon is Wizard
       And Uglak is Goblin
       And Uglak is almost dead
       And Uglak is standing in room
       And Simon is standing away from Uglak

  Scenario: Magic missile
       When Simon casts magic missile to Uglak
       Then Uglak should be dead

  Scenario: Fireball
      Given Zhagh is Goblin
        And Zhag is almost dead
        And Zhag is next to Uglak
        And Simon is standing away from Zhag
       When Simon casts fireball to Zhag
       Then Uglak should be dead
        And Zhag should be dead

  Scenario: Healing
      Given Simon is almost dead
       When Simon casts healing wind
       Then Simon should be in full health

  Scenario: Domain specialization
      Given Simon has Rune
       When Simon uses rune for fire domain
       Then Simon should have more fire spells
        And Rune should not be in inventory of Simon

  Scenario: Out of mana
      Given Simon has no mana left
       When Simon casts magic missile to Uglak
       Then Uglak should be alive

One aspect that is not captured by these tests is user interface. The reason for this is that I have not found a good way to write high level tests for user interface. I can write simple unit test style tests for Qt interface, but those are too verbose and complicated to be written at this point I think.

Results from the tests at this point:

7 features passed, 0 failed, 1 skipped
15 scenarios passed, 0 failed, 5 skipped
109 steps passed, 0 failed, 39 skipped, 5 undefined
Took 0m0.5s
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s