Last active
January 15, 2016 20:40
-
-
Save collinsauve/a81d73caede0fc904aa7 to your computer and use it in GitHub Desktop.
Temp
This file contains hidden or 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
@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