SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.22k stars 752 forks source link

#2608: Await the call to FeatureBackgroundAsync #2654

Closed laingsimon closed 1 year ago

laingsimon commented 1 year ago

Ensure that calls to FeatureBackgroundAsync are awaited when called, i.e.

Instead of this

// ... snip ...
#line 4
    this.FeatureBackgroundAsync();
#line hidden
// ... snip ...

Generate this

// ... snip ...
#line 4
    await this.FeatureBackgroundAsync();
#line hidden
// ... snip ...

Types of changes

Checklist:


Note: I've not added tests or an entry to the change log for the following reasons:

laingsimon commented 1 year ago

Manual tests performed:

  1. Build TechTalk.SpecFlow.Generator project
  2. Copy <repo>\TechTalk.SpecFlow.Generator\bin\Debug\netcoreapp3.1\TechTalk.SpecFlow.Generator.dll over %userprofile%\.nuget\packages\specflow.tools.msbuild.generation\4.0.16-beta\tasks\netcoreapp3.1\TechTalk.SpecFlow.Generator.dll
  3. Rebuild client project
  4. Observe a change to the built xxx.feature.cs file in client project

Before

#line 4
    this.FeatureBackgroundAsync();
#line hidden

After

#line 4
    await this.FeatureBackgroundAsync();
#line hidden