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

TestCaseCleanup() private méthode

private TestCaseCleanup ( ) : void
Résultat void
        public void TestCaseCleanup()
        {
            // Remove all files in a document Library, which is used as the store location for the files exported.
            this.sutAdapter.EmptyDocumentLibrary(string.Empty, string.Empty, Common.GetConfigurationPropertyValue(Constants.ValidLibraryName, this.Site));

            // Remove an imported site if it is imported successfully.
            if (this.isWebImportedSuccessfully)
            {
                // Since the DeleteWeb operation is not supported under the following product, an SUT method is called to do the same thing.
                if (Common.GetConfigurationPropertyValue(Constants.SutVersion, this.Site).Equals(Constants.SharePointServer2007, System.StringComparison.CurrentCultureIgnoreCase)
                    || Common.GetConfigurationPropertyValue(Constants.SutVersion, this.Site).Equals(Constants.WindowsSharePointServices3, System.StringComparison.CurrentCultureIgnoreCase))
                {
                    this.sutAdapter.RemoveWeb(this.newSubsite);
                }
                else
                {
                    try
                    {
                        this.sitessAdapter.InitializeWebService(UserAuthenticationOption.Authenticated);
                        this.sitessAdapter.DeleteWeb(Common.GetConfigurationPropertyValue(Constants.SiteName, this.Site) + "/" + this.newSubsite);
                    }
                    catch (SoapException e)
                    {
                        Site.Log.Add(LogEntryKind.Comment, "S1_MigrateSite_TestCleanup: ");
                        Site.Log.Add(LogEntryKind.Comment, e.Code.ToString());
                        Site.Log.Add(LogEntryKind.Comment, e.Message);
                    }
                }

                this.isWebImportedSuccessfully = false;
            }

            this.sitessAdapter.Reset();
            this.sutAdapter.Reset();
        }