Witali,
On 12/3/13 2:42 AM, witali mik wrote:
> Hello Guys,
>
> thx for the Hints, i gues iam fine when i test the possible attribute
> ranges on the Items. The only thing is, that if someone change the
> formula for calculating the attributes, they tests may fail, but i gues
> this would be a specific usecase so for another usecase i have to write
> another test.
Your tests are specifications. If you want different behavior, you
SHOULD write another test.
>
> currently i have that cucumber feature and it feels right + easy to test
>
> |
> Scenario:GenerateItem
> GivenI'am user "BlackScorp"
> When I generate an item "<item_type>"
> Then I should see an item "<item_type>"
> And the item should have following attributes:
> | name | min | max |
> | strength | <min_strength> | <max_strength> |
> | constitution | <min_constitution> | <max_constitution> |
> | intelligence | <min_intelligence> | <max_intelligence> |
> | willpower | <min_willpower> | <max_willpower> |
> | dexterity | <min_dexterity> | <max_dexterity> |
> And the item should cost between <min_price> and <max_price>
> And the item should contain following informations:
> | name |
> | type |
> | image |
> | description |
> |
>
That is a very weak test and will not tell you much unless you run it
very many times. I would suggest a unit test on the constructor of the
object that demonstrates disallowing illegal combinations of attributes.
- George
> > an email to
clean-code-discu...@googlegroups.com
> <javascript:>.
> > To post to this group, send email to
>
clean-code...@googlegroups.com <javascript:>.
> <
http://groups.google.com/group/clean-code-discussion>.
>
> --
>
> ----------------------------------------------------------------------
> * George Dinwiddie *
http://blog.gdinwiddie.com
> Software Development
http://www.idiacomputing.com
> Consultant and Coach
http://www.agilemaryland.org
>
> ----------------------------------------------------------------------
>
> --
> The only way to go fast is to go well.
> ---
> You received this message because you are subscribed to the Google
> Groups "Clean Code Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
clean-code-discu...@googlegroups.com.