Microsoft.Protocols.TestSuites.MS_ASPROV.S03_ProvisionNegative.MSASPROV_S03_TC07_VerifyStatus141 C# (CSharp) Method

MSASPROV_S03_TC07_VerifyStatus141() private method

private MSASPROV_S03_TC07_VerifyStatus141 ( ) : void
return void
        public void MSASPROV_S03_TC07_VerifyStatus141()
        {
            #region Call Provision command to download the policy settings.
            // Download the policy setting.
            ProvisionResponse provisionResponse = this.CallProvisionCommand(string.Empty, "MS-EAS-Provisioning-WBXML", "1");
            string temporaryPolicyKey = provisionResponse.ResponseData.Policies.Policy.PolicyKey;
            #endregion

            #region Call Provision command to acknowledge the policy settings and get the valid PolicyKey
            // Acknowledge the policy setting.
            provisionResponse = this.CallProvisionCommand(temporaryPolicyKey, "MS-EAS-Provisioning-WBXML", "1");

            string finalPolicyKey = provisionResponse.ResponseData.Policies.Policy.PolicyKey;
            #endregion

            #region Call FolderSync command with an emtry PolicyKey.
            if ("12.1" != Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site))
            {
                // Apply an emtry policy key
                this.PROVAdapter.ApplyPolicyKey(string.Empty);

                // Call folder sync with "0" in initialization phase.
                FolderSyncRequest folderSyncRequest = Common.CreateFolderSyncRequest("0");

                FolderSyncResponse folderSyncResponse = this.PROVAdapter.FolderSync(folderSyncRequest);

                this.Site.CaptureRequirementIfAreEqual<int>(
                    141,
                    int.Parse(folderSyncResponse.ResponseData.Status),
                    682,
                    @"[In Provision Command Errors] [The meaning of status value] 141 [is] The device is not provisionable.");

                this.Site.CaptureRequirementIfAreEqual<int>(
                    141,
                    int.Parse(folderSyncResponse.ResponseData.Status),
                    458,
                    @"[In Provision Command Errors] [The cause of status value 141 is] The client did not submit a policy key value in a request.");

                this.Site.CaptureRequirementIfAreEqual<int>(
                    141,
                    int.Parse(folderSyncResponse.ResponseData.Status),
                    685,
                    @"[In Provision Command Errors] [The cause of status value 141 is] The server is configured to not allow clients that do not submit a policy key value.");
            }
            #endregion
        }
    }