Created
February 21, 2019 21:56
-
-
Save avegaraju/505104b11cb45fda1bd0e7dca0b68f48 to your computer and use it in GitHub Desktop.
Imposter for orders endpoint which responds based on a condition.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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