/// <summary> /// Assert that the <see cref="HttpRequestMessage"/> generated by the <see cref="HttpRequest"/> has the specified URI. /// </summary> /// <typeparam name="TContext"> /// The type of object used as a context for resolving deferred parameters. /// </typeparam> /// <param name="request"> /// The <see cref="HttpRequest"/>. /// </param> /// <param name="method"> /// The HTTP method (e.g. GET / POST / PUT). /// </param> /// <param name="context"> /// The <typeparamref name="TContext"/> instance used as a context for resolving deferred values for each request. /// </param> /// <param name="baseUri"> /// The base URI for the request. /// </param> /// <param name="expectedUri"> /// The expected URI. /// </param> public static void MessageHasUri <TContext>(HttpRequest <TContext> request, HttpMethod method, TContext context, Uri baseUri, Uri expectedUri) { Message(request, method, context, baseUri, requestMessage => { MessageAssert.HasRequestUri(requestMessage, expectedUri); }); }
/// <summary> /// Assert that the <see cref="HttpRequestMessage"/> generated by the <see cref="HttpRequest"/> has the specified URI. /// </summary> /// <param name="request"> /// The <see cref="HttpRequest"/>. /// </param> /// <param name="method"> /// The HTTP method (e.g. GET / POST / PUT). /// </param> /// <param name="baseUri"> /// The base URI for the request. /// </param> /// <param name="expectedUri"> /// The expected URI. /// </param> public static void MessageHasUri(HttpRequest request, HttpMethod method, Uri baseUri, Uri expectedUri) { Message(request, method, baseUri, requestMessage => { MessageAssert.HasRequestUri(requestMessage, expectedUri); }); }
/// <summary> /// Assert that the <see cref="HttpRequestMessage"/> generated by the <see cref="HttpRequest"/> has the specified URI. /// </summary> /// <typeparam name="TContext"> /// The type of object used as a context for resolving deferred parameters. /// </typeparam> /// <param name="request"> /// The <see cref="HttpRequest"/>. /// </param> /// <param name="method"> /// The HTTP method (e.g. GET / POST / PUT). /// </param> /// <param name="context"> /// The <typeparamref name="TContext"/> instance used as a context for resolving deferred values for each request. /// </param> /// <param name="baseUri"> /// The base URI for the request. /// </param> /// <param name="expectedUri"> /// The expected URI. /// </param> public static void MessageHasUri <TContext>(HttpRequest <TContext> request, HttpMethod method, TContext context, Uri baseUri, string expectedUri) { if (String.IsNullOrWhiteSpace(expectedUri)) { throw new ArgumentException("Argument cannot be null, empty, or composed entirely of whitespace: 'expectedUri'.", nameof(expectedUri)); } Message(request, method, context, baseUri, requestMessage => { MessageAssert.HasRequestUri(requestMessage, expectedUri); }); }