SpecFlow icon indicating copy to clipboard operation
SpecFlow copied to clipboard

Removal of virtual in generated methods breaks plugins who use proxy to intercept

Open jvitor83 opened this issue 3 years ago • 1 comments

SpecFlow Version

3.9.58

Which test runner are you using?

NUnit

Test Runner Version Number

3.9.58

.NET Implementation

.NET 5.0

Project Format of the SpecFlow project

Classic project format using <PackageReference> tags

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Visual Studio Test Explorer

SpecFlow Section in app.config or content of specflow.json

No response

Issue Description

This PR https://github.com/SpecFlowOSS/SpecFlow/pull/2410 remove the virtual from the generated methods, so plugins like the SharedSteps stopped working.

Please bring back the virtual.

Steps to Reproduce

Any feature.cs generated with version 3.9.52 gets virtual methods. If the package is updated to 3.9.58, the methods became final (non-virtual). And any plugin who uses proxy to intercept those methods will stop working.

Link to Repro Project

No response

jvitor83 avatar May 26 '22 20:05 jvitor83

Ok, this was not on purpose. But these methods were also not meant to be used for plugins.

If you send us a PR to redo the change, I merge it in. But it will only be included in 3.10.

SabotageAndi avatar May 30 '22 13:05 SabotageAndi