Feature: Expose scenario states #119

Closed
opened 2025-12-29 08:22:31 +01:00 by adam · 4 comments
Owner

Originally created by @benjamin-bader on GitHub (Jul 5, 2018).

I'd like to be able to ask the server what the current state is for a given feature, for example to concisely verify that all expected requests were received, e.g.

Check.That(server.Scenarios["oauth flow"].State).Is("finished");

One could get the same effect today by groveling through the LogEntries, but this is tedious and duplicates the logical chain set up by the scenario itself.

Originally created by @benjamin-bader on GitHub (Jul 5, 2018). I'd like to be able to ask the server what the current state is for a given feature, for example to concisely verify that all expected requests were received, e.g. ```csharp Check.That(server.Scenarios["oauth flow"].State).Is("finished"); ``` One could get the same effect today by groveling through the LogEntries, but this is tedious and duplicates the logical chain set up by the scenario itself.
adam closed this issue 2025-12-29 08:22:32 +01:00
Author
Owner

@StefH commented on GitHub (Jul 8, 2018):

Good idea.

I need to extend the admin api with some get request to retrieve the state from a certain scenario.

Also add this logic to the fluent interface.

@StefH commented on GitHub (Jul 8, 2018): Good idea. I need to extend the admin api with some get request to retrieve the state from a certain scenario. Also add this logic to the fluent interface.
Author
Owner

@StefH commented on GitHub (Jul 17, 2018):

Hello @benjamin-bader,

I've added some functionality in this branch, you can already take a look how it can be used as you proposed here:
https://github.com/WireMock-Net/WireMock.Net/blob/Expose_scenario_states/test/WireMock.Net.Tests/StatefulBehaviorTests.cs#L66

@StefH commented on GitHub (Jul 17, 2018): Hello @benjamin-bader, I've added some functionality in this branch, you can already take a look how it can be used as you proposed here: https://github.com/WireMock-Net/WireMock.Net/blob/Expose_scenario_states/test/WireMock.Net.Tests/StatefulBehaviorTests.cs#L66
Author
Owner

@benjamin-bader commented on GitHub (Jul 17, 2018):

Oh, cool! I was going to try my hand at this, but you've beaten me to it. Thank you for taking the effort!

@benjamin-bader commented on GitHub (Jul 17, 2018): Oh, cool! I was going to try my hand at this, but you've beaten me to it. Thank you for taking the effort!
Author
Owner

@StefH commented on GitHub (Jul 18, 2018):

OK, I'll change the code and create a new NuGet in some time...

@StefH commented on GitHub (Jul 18, 2018): OK, I'll change the code and create a new NuGet in some time...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#119