コード例 #1
0
        public static HttpRequestMessage GetRequest(this RequestBuilder requestBuilder)
        {
            var req = typeof(RequestBuilder).GetField("_req", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

            return((HttpRequestMessage)req.GetValue(requestBuilder));
        }
コード例 #2
0
 public static Task <HttpResponseMessage> PutAsync(this RequestBuilder builder)
 {
     return(builder.SendAsync(HttpMethods.Put));
 }
コード例 #3
0
 /// <summary>
 /// Get the header string for the provided claims
 /// </summary>
 /// <param name="requestBuilder">The requestBuilder instance</param>
 /// <param name="claims">The claims collection that represents the user identity</param>
 /// <returns></returns>
 public static string GetHeaderForIdentity(this RequestBuilder requestBuilder, IEnumerable <Claim> claims)
 {
     return(requestBuilder.GetHeaderForIdentity(
                claims,
                TestServerDefaults.AuthenticationScheme));
 }
コード例 #4
0
 public static Task <HttpResponseMessage> DeleteAsync(this RequestBuilder requestBuilder)
 {
     return(requestBuilder.SendAsync(HttpMethods.Delete));
 }
コード例 #5
0
 /// <summary>
 /// Adds an Authentication header to the <see cref="RequestBuilder"/> with the provided claims using
 /// "TestServer" as authentication scheme.
 /// </summary>
 /// <param name="requestBuilder">The requestBuilder instance</param>
 /// <param name="claims">The claims collection that represents the user identity</param>
 /// <returns></returns>
 public static RequestBuilder WithIdentity(this RequestBuilder requestBuilder, IEnumerable <Claim> claims)
 {
     return(requestBuilder.WithIdentity(
                claims,
                TestServerDefaults.AuthenticationScheme));
 }