It seems like perfectly fine code to me.
I guess you are wondering if the code directly in "given" (without a "when" clause) is "proper". The answer is yes. That's one feature that distinguishes given/when from the switch statement in C.
But do consider that such code could become hard to read if the whole given/when doesn't fit onto one or two screen pages anymore - you shouldn't be doing very much in the when clauses (calling functions or methods should be fine).
In reply to Re^2: given/when one case prefixes another
by moritz
in thread given/when one case prefixes another
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |