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

VerifyAuthentication() private method

Verify the requirements related to authentication.
private VerifyAuthentication ( HttpWebResponse response ) : void
response System.Net.HttpWebResponse The HttpWebResponse to be verified.
return void
        private void VerifyAuthentication(HttpWebResponse response)
        {
            // If the StatusCode in response is OK, then the request has been authenticated by server.
            if (response.StatusCode == HttpStatusCode.OK)
            {
                // Add the debug information
                this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R35");

                // Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R35
                // If the StatusCode in response is OK, then the request has been authenticated by server.
                // If the response includes the X-RequestType header and X-ResponseCode header, then the response follows MS-OXCMAPIHTTP.
                // So when the request has been authenticated and the response follows MS-OXCMAPIHTTP, server will return a correct response and R35 will be verified.
                bool isVerifiedR35 = response.Headers["X-RequestType"] != null && response.Headers["X-ResponseCode"] != null;

                this.Site.CaptureRequirementIfIsTrue(
                    isVerifiedR35,
                    35,
                    @"[In POST Method] All requests MUST be authenticated prior to being processed by server.");
            }
        }
        #endregion
MS_OXCMAPIHTTPAdapter