Microsoft.Protocols.TestSuites.MS_OFFICIALFILE.S01_GetRoutingDestinationUrlAndSubmitFile.MSOFFICIALFILE_S01_TC07_GetFinalRoutingDestinationFolderUrl_ParsingDisabledAtDestination C# (CSharp) Method

MSOFFICIALFILE_S01_TC07_GetFinalRoutingDestinationFolderUrl_ParsingDisabledAtDestination() private method

        public void MSOFFICIALFILE_S01_TC07_GetFinalRoutingDestinationFolderUrl_ParsingDisabledAtDestination()
        {
            if (!Common.Common.IsRequirementEnabled(353, this.Site))
            {
                Site.Assume.Inconclusive("Implementation does not support the GetFinalRoutingDestinationFolderUrl operations.");
            }

            // Initial server parameters to use a repository that is configured for routing content and parsing file metadata is disabled.
            InitialPara paras = new InitialPara();
            paras.Url = this.EnableRoutingFeatureRecordsCenterServiceUrl;
            paras.UserName = this.SubmitUserName;
            paras.Domain = this.DomainName;
            paras.Password = this.Password;
            this.Adapter.IntializeService(paras);

            bool isSucceed = false;
            string siteUrl = Common.Common.GetConfigurationPropertyValue("EnableContentOrganizerRecordsCenterSite", this.Site);

            // Turn off the file metadata parsing on the record center site.
            isSucceed = this.SutControlAdapter.SwitchFileMetaDataParsingFeature(siteUrl, false);
            this.Site.Assert.IsTrue(
                isSucceed,
                string.Format("Turning off file metadata parsing should succeed on the site {0}, the actual result is {1}", siteUrl, isSucceed ? "success" : "failure"));

            // Properties of the file to submit which is configured in the file PropertyConfig.xml.
            RecordsRepositoryProperty[] fileProperties = this.ConstructAllRequiredProperties();

            // call GetFinalRoutingDestinationFolderUrl on a repository that is configured for routing content and parsing file metadata is disabled, expect the server responses ParsingDisabledAtDestination.
            DocumentRoutingResult docRoutingResult = this.Adapter.GetFinalRoutingDestinationFolderUrl(fileProperties, this.DocumentContentTypeName, this.GetOriginalSaveLocation(this.DocumentLibraryUrlOfAppendUniqueSuffix));

            bool isR73Verified = !string.IsNullOrEmpty(docRoutingResult.Url);

            // Add the log information.
            Site.Log.Add(
                    Microsoft.Protocols.TestTools.LogEntryKind.Comment,
                    "Url = {0}, when the GetFinalRoutingDestinationFolderUrl succeeds.", 
                    docRoutingResult.Url);

            Site.Log.Add(
                  Microsoft.Protocols.TestTools.LogEntryKind.Debug,
                  "Expect the URL is not empty when the GetFinalRoutingDestinationFolderUrl succeeds, actually it is {0}",
                  isR73Verified ? "not empty" : "empty");

            // Verify MS-OFFICIALFILE requirement: MS-OFFICIALFILE_R73
            Site.CaptureRequirementIfIsTrue(
                     isR73Verified,
                     "MS-OFFICIALFILE",
                     73,
                     @"[In GetFinalRoutingDestinationFolderUrl] [The protocol client sends a GetFinalRoutingDestinationFolderUrlSoapIn request WSDL message, and the protocol server MUST respond with a GetFinalRoutingDestinationFolderUrlSoapOut response WSDL message, as follows:] 10. [If other implementation-specific errors occur while determining the storage location for the submission, the protocol server MUST set the ResultType element to ""UnknownFailure"" and return.] Otherwise, the protocol server sets Url to the storage location determined by the rules, which MUST be non-empty.");

            // Verify MS-OFFICIALFILE requirement: MS-OFFICIALFILE_R92 and MS-OFFICIALFILE_R126
            // This repository is a record center and its default setting is parsing disabled. 
            Site.CaptureRequirementIfAreEqual<DocumentRoutingResultType>(
                     DocumentRoutingResultType.ParsingDisabledAtDestination,
                     docRoutingResult.ResultType,
                     "MS-OFFICIALFILE",
                     92,
                     @"[In GetFinalRoutingDestinationFolderUrl] [The protocol client sends a GetFinalRoutingDestinationFolderUrlSoapIn request WSDL message, and the protocol server MUST respond with a GetFinalRoutingDestinationFolderUrlSoapOut response WSDL message, as follows:] 11. If parsing of file metadata is disabled on the repository, the protocol server MUST set the ResultType to ""ParsingDisabledAtDestination"".");

            Site.CaptureRequirementIfAreEqual<DocumentRoutingResultType>(
                     DocumentRoutingResultType.ParsingDisabledAtDestination,
                     docRoutingResult.ResultType,
                     "MS-OFFICIALFILE",
                     126,
                     @"[In DocumentRoutingResultType] [If] Parsing is not enabled on the repository, [DocumentRoutingResultType] value is ParsingDisabledAtDestination.");
        }
S01_GetRoutingDestinationUrlAndSubmitFile