Multiple Multi-Line Examples in a SpecFlow Feature

2,669 views
Skip to first unread message

grefly

unread,
Jun 1, 2011, 8:30:49 AM6/1/11
to spec...@googlegroups.com
How would I go about defining multiple multi-line examples in a SpecFlow Feature file? For example:

Given some long input
| input |
|
"""
This is the first line of long input
This is the second line of long input
""" |
|
"""
This is the first line of longer input
because it is longer than the first example
and also different.
"""
When something happens
Then my state is expected

Darren Cauthon

unread,
Jun 1, 2011, 9:35:01 AM6/1/11
to SpecFlow

You can't, as far as I know. Tables just don't work that way.

If I just *HAD* to do this, then this is probably a situation where
I'd use the \r\n. But even then, I'd just be setting up myself for
failure because if I'm writing specs for such fine details such as
line breaks, the processing of that text is only going to get more
complex and it's not going to be very readable.

Just in case this helps: You don't have to use SpecFlow to test your
entire feature here. It's fine to use it as a way to demonstrate the
"main" scenarios that your feature is concerned about, and then leave
the finer details to unit tests.


Darren Cauthon
Reply all
Reply to author
Forward
0 new messages