sdk/dotnet/test/Datasync.Common.Test/AssertEx.cs
/// <summary>
/// Asserts if the headers contains the specific header provided
/// </summary>
/// <param name="response"></param>
/// <param name="headerName"></param>
/// <param name="expected"></param>
Asserts if the headers contains the specific header provided
Asserts if the headers contains the specific header provided
public static void HasHeader(HttpResponseMessage response, string headerName, string expected)
        {
            if (headerName.Equals("Last-Modified", StringComparison.InvariantCultureIgnoreCase) || headerName.StartsWith("Content-", StringComparison.InvariantCultureIgnoreCase))
            {
                HasHeader(response.Content.Headers, headerName, expected);
            }
            else
            {
                HasHeader(response.Headers, headerName, expected);
            }
        }
public static void HasHeader ( HttpResponseMessage response , string headerName , string expected ) { if ( headerName . Equals ( " " , StringComparison . InvariantCultureIgnoreCase ) || headerName . StartsWith ( " " , StringComparison . InvariantCultureIgnoreCase ) ) { HasHeader ( response . Content . Headers , headerName , expected ) ; } else { HasHeader ( response . Headers , headerName , expected ) ; } }
Asserts if the headers contains the specific header provided
Asserts if the headers contains the specific header provided
response
HttpResponseMessage
None
headerName
string
None
expected
string
None