Microsoft.Protocols.TestSuites.MS_SITESS.S01_MigrateSite.MSSITESS_S01_TC08_ImportingFailureInvalidImportUrl C# (CSharp) Méthode

MSSITESS_S01_TC08_ImportingFailureInvalidImportUrl() private méthode

private MSSITESS_S01_TC08_ImportingFailureInvalidImportUrl ( ) : void
Résultat void
        public void MSSITESS_S01_TC08_ImportingFailureInvalidImportUrl()
        {
            Site.Assume.IsTrue(Common.IsRequirementEnabled(5311, this.Site) && Common.IsRequirementEnabled(5391, this.Site), @"Test is executed only when R5311Enabled and R5391Enabled are set to true.");

            #region Variables

            string exportUrl = Common.GetConfigurationPropertyValue(Constants.NormalSubsiteUrl, this.Site);
            string importUrl = Common.GetConfigurationPropertyValue(Constants.NonExistentImportUrl, this.Site);
            string dataPath = Common.GetConfigurationPropertyValue(Constants.DataPath, this.Site);
            string logPath = string.Empty;
            string exportJobName = Constants.ExportJobName + Common.FormatCurrentDateTime();
            string[] dataFiles = new string[] { dataPath + "/" + exportJobName + Constants.CmpExtension };
            int cabSize = 50;
            int exportWebResult = 0;
            int importWebResult = 0;
            string[] exportWebFiles = null;
            string[] expectedWebFiles = null;

            #endregion Variables

            // Initialize the web service with an authenticated account.
            this.sitessAdapter.InitializeWebService(UserAuthenticationOption.Authenticated);

            // Invoke the ExportWeb operation with valid parameters, 1 is expected to be returned and only one cmp file is expected to be exported.
            exportWebResult = this.sitessAdapter.ExportWeb(exportJobName, exportUrl, dataPath, true, true, true, cabSize);

            #region Capture requirements

            // If 1 is returned, requirements related with ExportWeb pending can be verified.
            this.VerifyExportWebInProgress(exportWebResult);

            #endregion Capture requirements

            string files = TestSuiteHelper.VerifyExportAndImportFile(exportJobName, 2, this.Site, this.sutAdapter);
            exportWebFiles = files == null ? null : files.TrimEnd(new char[] { ';' }).Split(';');

            // Format the expected file names in the document library. Only one cmp file (i.e. ExportWeb.cmp) is expected to be exported in the document library.
            expectedWebFiles = new string[]
            {
                exportJobName + Constants.SntExtension,
                exportJobName + Constants.CmpExtension
            };

            Site.Assert.IsTrue(AdapterHelper.CompareStringArrays(expectedWebFiles, exportWebFiles), "Export web files' names should be {0} and {1}, and actually the exported file list is: {2}", expectedWebFiles[0], expectedWebFiles[1], files);

            logPath = dataPath;

            // Invoke the ImportWeb operation with invalid webUrl, 4 is expected to be returned.
            importWebResult = this.sitessAdapter.ImportWeb(Constants.ImportJobName, importUrl, dataFiles, logPath, true, true);

            #region Capture requirements

            // If 4 is returned, R269 can be captured.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R269");

            // Verify MS-SITESS requirement: MS-SITESS_R269
            Site.CaptureRequirementIfAreEqual<int>(
                4,
                importWebResult,
                269,
                @"[In ImportWebResponse] [ImportWebResult:] If the value of ImportWebResult is 4, it specifies InvalidImportUrl: The site specified in the webUrl is not accessible.");

            this.VerifyImportWebErrorCode(importWebResult);

            #endregion Capture requirements

            #region Capture requirements

            // Verify that Microsoft Windows SharePoint Services 3.0 and above support operation ExportWeb.
            this.VerifyOperationExportWeb();

            // Verify that Microsoft Windows SharePoint Services 3.0 and above support operation ImportWeb.
            this.VerifyOperationImportWeb();

            #endregion Capture requirements
        }