Microsoft.Protocols.TestSuites.MS_DWSS.S04_ManageDocuments.MSDWSS_S04_TC01_FindDwsDoc_ValidId C# (CSharp) Method

MSDWSS_S04_TC01_FindDwsDoc_ValidId() private method

private MSDWSS_S04_TC01_FindDwsDoc_ValidId ( ) : void
return void
        public void MSDWSS_S04_TC01_FindDwsDoc_ValidId()
        {
            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 dwsTitle = Common.GetConfigurationPropertyValue("ValidTitle", Site) + "_" + Common.FormatCurrentDateTime();

            CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, dwsTitle, documents, out error);
            
            // Redirect the web service to the newly created site.
            this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site);
            
            // Find the document with valid document id.
            string findDwsDocResult = this.dwsAdapter.FindDwsDoc(documents.ID, out error);
            this.Site.Assert.IsNull(error, "The response should not be an error!");

            Uri uriAddress = new Uri(findDwsDocResult);
            
            // Add the debug information
            this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R536");
            
            // Verify MS-DWSS requirement: MS-DWSS_R536
            this.Site.CaptureRequirementIfIsTrue(
                uriAddress.IsAbsoluteUri,
                536,
                @"[In FindDwsDocResponse] Result: A Result element for which the content MUST be an absolute URL that refers to the requested document.");
            
            if (Common.IsRequirementEnabled(687, this.Site))
            {
                // Add the debug information
                this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R687");
                
                // Verify MS-DWSS requirement: MS-DWSS_R687
                this.Site.CaptureRequirementIfIsTrue(
                    uriAddress.IsAbsoluteUri,
                    687,
                    @"[In Appendix B: Product Behavior] Implementation does reply with a Result element as specified in FindDwsDocResponse containing an absolute URL to the specified document. (Windows® SharePoint® Services 3.0 and above products follow this behavior.)");
            }
            
            // Find the document without document id.
            this.dwsAdapter.FindDwsDoc(null, out error);
            this.Site.Assert.IsNotNull(error, "The response is expected to be an error!");
            
            this.dwsAdapter.DeleteDws(out error);
            this.Site.Assert.IsNull(error, "The response should not be an error!");
        }