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));
 }