Microsoft.Protocols.TestSuites.MS_OXCMAPIHTTP.MS_OXCMAPIHTTPAdapter.VerifyAdditionalHeaders C# (CSharp) Method

VerifyAdditionalHeaders() private method

Verify the requirements related to additional header.
private VerifyAdditionalHeaders ( string>.Dictionary additionalHeaders ) : void
additionalHeaders string>.Dictionary The additional headers.
return void
        private void VerifyAdditionalHeaders(Dictionary<string, string> additionalHeaders)
        {
            string elapsedTimeHeader = additionalHeaders["X-ElapsedTime"];
            int elapsedTimeHeaderValue;

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R169");

            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R169
            // Because the additional headers are parsed from the final response according to Open Specification. 
            // So if the X-ElapsedTime is not null, then R169 will be verified.
            this.Site.CaptureRequirementIfIsNotNull(
                elapsedTimeHeader,
                169,
                @"[In X-ElapsedTime Header Field] This header [X-ElapsedTime] is returned by the server as an additional header in the final response.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R168: the X-ElapsedTime header is {0}", elapsedTimeHeader);

            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R168
            this.Site.CaptureRequirementIfIsTrue(
                int.TryParse(elapsedTimeHeader, out elapsedTimeHeaderValue),
                168,
                @"[In X-ElapsedTime Header Field] The X-ElapsedTime header specifies the amount of time, in milliseconds, that the server took to process the request.");

            string startTimeHeader = additionalHeaders["X-StartTime"];
            DateTime startTime;

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R171");

            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R171
            // Because the additional headers are parsed from the final response according to Open Specification. 
            // So if the X-StartTime is not null, then R171 will be verified.
            this.Site.CaptureRequirementIfIsNotNull(
                startTimeHeader,
                171,
                @"[In X-StartTime Header Field] This header [X-StartTime] is returned by the server as an additional header in the final response.");

            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R170");

            // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R170
            // Because the additional headers are parsed from the final response according to Open Specification. 
            // So if the X-StartTime is not null and the value is a valid time, then R170 will be verified.
            this.Site.CaptureRequirementIfIsTrue(
                startTimeHeader != null && DateTime.TryParse(startTimeHeader, out startTime),
                170,
                @"[In X-StartTime Header Field] The X-StartTime header specifies the time that the server started processing the request.");
        }
        #endregion
MS_OXCMAPIHTTPAdapter