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

MSSITESS_S01_TC10_ImportingFailureLogFileNoAccess() private méthode

private MSSITESS_S01_TC10_ImportingFailureLogFileNoAccess ( ) : void
Résultat void
        public void MSSITESS_S01_TC10_ImportingFailureLogFileNoAccess()
        {
            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 siteUrl = Common.GetConfigurationPropertyValue(Constants.SiteUrl, this.Site);
            string exportUrl = Common.GetConfigurationPropertyValue(Constants.NormalSubsiteUrl, this.Site);
            string importUrl = siteUrl + "/" + this.newSubsite;
            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);

            // Invoke the ImportWeb operation with invalid logPath, 11 is expected to returned.
            logPath = exportUrl + "/" + Common.GetConfigurationPropertyValue(Constants.InvalidLibraryName, this.Site);
            importWebResult = this.sitessAdapter.ImportWeb(Constants.ImportJobName, importUrl, dataFiles, logPath, true, true);

            #region Capture requirements

            this.VerifyImportWebErrorCode(importWebResult);

            // If 11 is returned, R273 can be captured.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R273");

            // Verify MS-SITESS requirement: MS-SITESS_R273
            Site.CaptureRequirementIfAreEqual<int>(
                11,
                importWebResult,
                273,
                @"[In ImportWebResponse] [ImportWebResult:] If the value of ImportWebResult is 11, it specifies LogFileNoAccess: The location specified by logPath is not accessible.");

            #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
        }