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

MSSITESS_S01_TC03_ExportingEqualto0x18CabSize() private méthode

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

            #region Variables
            string exportUrl = Common.GetConfigurationPropertyValue(Constants.SpecialSubsiteUrl, this.Site);
            string dataPath = Common.GetConfigurationPropertyValue(Constants.DataPath, this.Site);
            string exportJobName = Constants.ExportJobName + Common.FormatCurrentDateTime();
            int cabSize = 0;
            int exportWebResult = 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 cabSize set to 0, 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(';');

            expectedWebFiles = new string[]
            {
                exportJobName + Constants.SntExtension,
                exportJobName + Constants.CmpExtension
            };

            // If exported files are inconsistent with the expected, log it.
            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);

            this.sutAdapter.EmptyDocumentLibrary(string.Empty, string.Empty, Common.GetConfigurationPropertyValue(Constants.ValidLibraryName, this.Site));

            // Invoke the ExportWeb operation with cabSize set to 0x0400, 1 is expected to be returned and only one cmp file is expected to be exported.
            exportWebResult = 0;
            cabSize = 0x400;
            exportJobName = Constants.ExportJobName + Common.FormatCurrentDateTime();
            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

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

            // If exported files are inconsistent with the expected, log it.
            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);

            this.sutAdapter.EmptyDocumentLibrary(string.Empty, string.Empty, Common.GetConfigurationPropertyValue(Constants.ValidLibraryName, this.Site));

            // Invoke the ExportWeb operation with cabSize set to 0x0018, 1 is expected to be returned and only one cmp file is expected to be exported.
            exportWebResult = 0;
            cabSize = 0x18;
            exportJobName = Constants.ExportJobName + Common.FormatCurrentDateTime();
            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

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

            // If exported files are inconsistent with the expected, log it.
            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);

            #region Capture requirements

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

            #endregion Capture requirements

            this.sutAdapter.EmptyDocumentLibrary(string.Empty, string.Empty, Common.GetConfigurationPropertyValue(Constants.ValidLibraryName, this.Site));

            // Invoke the ExportWeb operation with cabSize set to 0x0018, 1 is expected to be returned and only one cmp file is expected to be exported.
            exportWebResult = 0;
            cabSize = -1;
            exportJobName = Constants.ExportJobName + Common.FormatCurrentDateTime();
            exportWebResult = this.sitessAdapter.ExportWeb(exportJobName, exportUrl, dataPath, true, true, true, cabSize);

            if (Common.IsRequirementEnabled(532, this.Site))
            {
                bool isR532Verified = exportWebResult == 1 || exportWebResult == 7;

                Site.Log.Add(LogEntryKind.Debug, "Verify MS-SITESS_R532");

                // Verify MS-SITESS requirement: MS-SITESS_R239
                Site.CaptureRequirementIfIsTrue(
                    isR532Verified,
                    532,
                    @"[In Appendix B: Product Behavior] <4> Section 3.1.4.2.2.1: If the value of cabSize is less than zero, Implementation does return a value of 1 or 7  but the server does not successfully complete the operation. The return code is not deterministic.(Windows SharePoint Services 3.0, SharePoint Foundation 2010, and SharePoint Foundation 2013 follow this behavior.)");
            }

        }