Microsoft.Protocols.TestSuites.MS_DWSS.S01_ManageSites.MSDWSS_S01_TC07_CreateDws_ServerFailure C# (CSharp) Method

MSDWSS_S01_TC07_CreateDws_ServerFailure() private method

private MSDWSS_S01_TC07_CreateDws_ServerFailure ( ) : void
return void
        public void MSDWSS_S01_TC07_CreateDws_ServerFailure()
        {
            this.dwsAdapter.ServiceUrl = Common.GetConfigurationPropertyValue("TestDWSSWebSite", this.Site);
            
            Error error;
            UsersItem users = new UsersItem();
            DocumentsItem documents = new DocumentsItem();
            
            users.Name = Common.GetConfigurationPropertyValue("UserName", this.Site);
            users.Email = Common.GetConfigurationPropertyValue("RegisteredUsersEmail", this.Site);
            
            documents.ID = Guid.NewGuid().ToString();
            documents.Name = Common.GetConfigurationPropertyValue("DocumentsName", this.Site) + "_" + Common.FormatCurrentDateTime();

            string dwsName = Common.GetConfigurationPropertyValue("SutComputerName", this.Site) + "_" + Common.FormatCurrentDateTime();
            string dwsTitle = Common.GetConfigurationPropertyValue("ValidTitle", this.Site) + "_" + Common.FormatCurrentDateTime();
            
            CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(dwsName, users, dwsTitle, documents, out error);
            this.Site.Assert.IsNotNull(createDwsRespResults, "The server should return a CreateDws response!");
            
            // Set the name to the name returned by CreateDws operation.
            this.dwsAdapter.CreateDws(dwsName, users, dwsTitle, documents, out error);
            
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R121");
            
            // Verify MS-DWSS requirement: MS-DWSS_R121
            this.Site.CaptureRequirementIfIsNotNull(
                error,
                121,
                @"[In CreateDws] The protocol server MUST reply with an Error element in the CreateDwsResponse response message if it fails to create the specified Document Workspace.");
            
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R682");
            
            // Verify MS-DWSS requirement: MS-DWSS_R682
            this.Site.CaptureRequirementIfIsNotNull(
                error,
                682,
                @"[In CreateDws] The protocol server MUST return a CreateDwsResponse response message with an Error element.");
            
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R458");
            
            // Verify MS-DWSS requirement: MS-DWSS_R458
            this.Site.CaptureRequirementIfAreEqual<ErrorTypes>(
                ErrorTypes.ServerFailure,
                error.Value,
                458,
                @"[In CreateDws] If this is non-empty and another site with the same name already exists on the site on which the workspace is being created, the protocol server MUST return a ServerFailure error code (see section 2.2.3.2).");
            
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R485");
            
            // Verify MS-DWSS requirement: MS-DWSS_R485
            this.Site.CaptureRequirementIfAreEqual<string>(
                "1",
                error.ID,
                485,
                @"[In CreateDwsResponse] ServerFailure, Identifier is ""1"", means: Protocol server encountered an error during the attempt to create the workspace.");
            
            if (Common.IsRequirementEnabled(1683, this.Site))
            {
                // Add the debug information
                this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R1683");
                
                // Verify MS-DWSS requirement: MS-DWSS_R1683
                this.Site.CaptureRequirementIfAreEqual<ErrorTypes>(
                    ErrorTypes.ServerFailure,
                    error.Value,
                    1683,
                    @"[In Appendix B: Product Behavior] Implementation does return error ServerFailure when a site with the specified name already exists on this site. (<5> When a site with the specified name already exists on this site, Windows SharePoint Services 3.0, SharePoint Foundation 2010 and SharePoint Foundation 2013 will return error ServerFailure instead of AlreadyExists.)");
            }
            
            this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site);
            this.dwsAdapter.DeleteDws(out error);
            this.Site.Assert.IsNull(error, "The server should not return an error!");
        }