SpecFlow.VisualStudio
SpecFlow.VisualStudio copied to clipboard
Generate Step definitions generate code which uses ScenarioContext.Current
Visual Studio Version
- [x] VS 2019
- [x] VS 2017
- [x] VS 2015
Are the latest Visual Studio updates installed?
- [x] Yes
- [ ] No
Issue Description
The Visual Studio Integration creates code, that uses the obsolete ScenarioContext.Current property.
Is there a replacement for Currrent.Pending();?
We could use the static one ScenarioContext.StepIsPending
(https://github.com/techtalk/SpecFlow/blob/master/TechTalk.SpecFlow/ScenarioContext.cs#L85).
The template is here: https://github.com/techtalk/SpecFlow/blob/master/TechTalk.SpecFlow/BindingSkeletons/DefaultSkeletonTemplates.sftemplate
But the be in effect, we have to upgrade the SpecFlow version in the Visual Studio extension.
@SabotageAndi StepIsPending is not part of the latest 2.x version, right?
No idea tbh.
The best is throw new PendingStepException();
is the best thing to generate IMHO.