Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Scenarios break when the name is too long #54

Closed
thomasbruggink opened this issue Sep 15, 2017 · 1 comment
Closed

Scenarios break when the name is too long #54

thomasbruggink opened this issue Sep 15, 2017 · 1 comment

Comments

@thomasbruggink
Copy link
Contributor

thomasbruggink commented Sep 15, 2017

#The following scenario name demonstrates the problem with long names
Scenario: This is an example of a case that will fail when the amount of characters in the scenario names goes beyond 80 characters
When using the original specflow exe to create cs files this results in the following glue code

[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]
[Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute("This is an example of a case that will fail when the amount of characters in the " +
"scenario names goes beyond 80 characters")]

The FixMsTest function uses a regex to remove the Description attribute which results in the following broken glue code

[Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()]

"scenario names goes beyond 80 characters")]

A simple fix is to extend the regex to span multiple lines and remove the Description correctly. Although I don't know why the description has to be removed since it appears to compile just fine.

Anyway I added a pull request to resolve this. # #55

@stajs
Copy link
Owner

stajs commented Sep 17, 2017

Cool, thanks for that!

I'm not using MSTest so I rely on the community to tidy these things up. If you don't think the Description needs to be removed (it seems wrong to me as well) then feel free to patch it with another PR 😄

@erik-lundgren added support for MSTest (almost a year ago now!) with #31. There was a reason at the time, but not sure if it's a good one.

@stajs stajs closed this as completed in 77f1ee1 Sep 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants