Skip to content

Instantly share code, notes, and snippets.

@collinsauve
Last active January 15, 2016 20:40
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 collinsauve/a81d73caede0fc904aa7 to your computer and use it in GitHub Desktop.
Save collinsauve/a81d73caede0fc904aa7 to your computer and use it in GitHub Desktop.
Temp
@FunctionalInterface
public interface Assertion<TArg1, TArg2, TArg3> {
void Execute(TArg1 arg1, TArg2 arg2, TArg3 arg3);
}
public static Assertion<RestContextBase, RestRequest, RestResponse> CreatedWithJsonBody() {
return (RestContextBase context, RestRequest y, RestResponse z) -> {
context.AssertStatusCode(y, z, 201); // 201 CREATED
context.AssertContentType(y, z, "application/json");
context.AssertContentLength(y, z, ContentLength.NonZero);
};
}
You have to specify the type params for Assertion. Just like in C#.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment