/// <summary> /// Tests whether the HTTP response message contains content header with certain name. /// </summary> /// <param name="name">Name of expected content header.</param> /// <returns>The same HTTP response message test builder.</returns> public IAndHttpResponseMessageTestBuilder ContainingContentHeader(string name) { HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException); HttpResponseMessageValidator.ContainingHeader( this.httpResponseMessage.Content.Headers, name, this.ThrowNewHttpResponseMessageAssertionException, isContentHeader: true); return(this); }
/// <summary> /// Testuje, či správa odozvy HTTP obsahuje záhlavie obsahu s určitým názvom a zberom hodnoty. /// </summary> /// <param name="name">Name of expected content header.</param> /// <param name="values">Collection of values in the expected content header.</param> /// <returns>The same HTTP response message test builder.</returns> public IAndHttpHandlerResponseMessageTestBuilder ValidContainingContentHeader(string name, IEnumerable <string> values) { HttpResponseMessageValidator.ValidateContent(this.httpResponseMessage.Content, this.ThrowNewHttpResponseMessageAssertionException); HttpResponseMessageValidator.ContainingHeader( this.httpResponseMessage.Content.Headers, name, values, this.ThrowNewHttpResponseMessageAssertionException, isContentHeader: true); return(this); }
/// <summary> /// Tests whether the HTTP response message contains response header with certain name and value. /// </summary> /// <param name="name">Name of expected response header.</param> /// <param name="value">Value of expected response header.</param> /// <returns>The same HTTP response message test builder.</returns> public IAndHttpResponseMessageTestBuilder ContainingHeader(string name, string value) { HttpResponseMessageValidator.ContainingHeader(this.httpResponseMessage.Headers, name, value, this.ThrowNewHttpResponseMessageAssertionException); return(this); }
/// <summary> /// Testuje, či správa o odozve HTTP obsahuje hlavičku odpovede s určitým názvom a zberom hodnoty. /// </summary> /// <param name="name">Name of expected response header.</param> /// <param name="values">Collection of values in the expected response header.</param> /// <returns>The same HTTP response message test builder.</returns> public IAndHttpResponseMessageTestBuilder ValidContainingHeader(string name, IEnumerable <string> values) { HttpResponseMessageValidator.ContainingHeader(this.ActionResult.Headers, name, values, this.ThrowNewHttpResponseMessageAssertionException); return(this); }