Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Imposter for orders endpoint which responds based on a condition.
public class OrdersImposter: IImposter
{
public Imposter Build()
{
return new ImposterDefinition("OrdersStub")
.DeclareResource("/api/Orders", HttpMethod.Post)
.When(r => r.Content.Contains("Product:1234"))
.Then(new OrdersResponseCreator())
.Build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.