Skip to content

Instantly share code, notes, and snippets.

@avegaraju
Created February 21, 2019 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avegaraju/505104b11cb45fda1bd0e7dca0b68f48 to your computer and use it in GitHub Desktop.
Save avegaraju/505104b11cb45fda1bd0e7dca0b68f48 to your computer and use it in GitHub Desktop.
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