I am new to Specflow so here goes;
For my example below Should I test for the bad at all? If I do the table won't let you add a bad value. So the code will error because its coming in as as bad type. I guess I just need to know how others handle verifying the user can't enter bad data? (fields names are changed due to confidential info) the requirement says:
Verify that the user cannot set the rate to be negative or greater than 1. The rate range is from 0.9999 to 0.
Verify that the user cannot enter a rate with more than 4 decimal places.
Given the lc does not exist
| Lc |
| Test90 |
| Test00 |
When I add a Lc
| Lc | Somekind of ID| Rate |
| Test90 | 2 | 0.9999 |
| Test00 | 4 | 0 |
Then the lc should be defined
| Lc |
| Test90 |
| Test00 |
It's a bit strange that you are testing 2 values thoughout your test.
I would be tempted to rewrite like this:
The
And an error should have been raised saying the rate was invalid
step is obviously optional but shows that this is expected to fail due to an invalid rate.