Closed stefan-schweiger closed 5 months ago
Hi,
sorry for the delay.
Tickspec does not implement integration with the unit testing framework to integrate with before steps and after steps. That is to keep it independent from the runner.
The right solution for your problem is to set a StepDefinitions.ServiceProviderFactory
property. That is called before every scenario to get IServiceProvider
. So, you can create instance of the server, start it and return a service provider that is able to return the server. That way, you can get the server as parameter in your steps. And at the end of a scenario execution it calls the Dispose()
method if the service provider implements it.
See advanced features in the readme. Feel free to reopen if it is not clear or you run into any issues.
Ah, actually I realized that I misread it. You mean the internal events that Tickspec provides. You are correct, that is a gap in functionality that should be filled in. In the meantime, you can use the above workaround.
Any love for this issue is greatly appreciated. This is the final missing piece.
Currently it's not possible to use shared arguments in Events like
BeforeStep
,AfterStep
,AfterScenario
(I don't think it makes sense forBeforeScenario
)For example this results in an error:
I know I can just use a mutable value instead, but then what's the point of using arguments at all? I think it would be great to be able to have the same arguments available in the events as in the step definitions.