public void MSDWSS_S03_TC06_CreateFolder_InvalidParentFolderUrl() { 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(); CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); // Redirect the web service to the newly created site. this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); // Create a sub folder in the web site. string folderUrl = "InvalidParentFolder/MSDWSS_TestFolder"; this.dwsAdapter.CreateFolder(folderUrl, out error); this.Site.Assert.IsNull(error, "The response is expected to be a <Result/>, not an error."); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); }
public void MSDWSS_S01_TC10_DeleteDws_DeleteCurrentSiteSuccessfully() { 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(); CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); // Redirect the web service to the newly created site. this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); // Delete the created web site. this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The response should not contains an error."); // If the response isn't an error, it indicate that the server returns a Result element this.Site.CaptureRequirement( 166, @"[In DeleteDws] If none of the prior conditions apply, the protocol server MUST delete the specified Document Workspace and return a Result element."); }
public void MSDWSS_S05_TC03_RemoveDwsUser_NoAccess() { 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(); CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); // Redirect the web service to the newly created site. this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); Results getDwsDataRespResults = this.dwsAdapter.GetDwsData(documents.Name, string.Empty, out error); this.Site.Assert.IsNull(error, "The response is expected to be a GetDwsDataResult not an error"); this.Site.Assert.IsNotNull(getDwsDataRespResults.Members.Items, "The members not expected to be null"); // Get first member Member firstMember = getDwsDataRespResults.Members.Items[0] as Member; this.Site.Assert.IsNotNull(firstMember, "The user should exist on server."); // Set Dws service credential to Reader credential. string userName = Common.GetConfigurationPropertyValue("ReaderRoleUser", this.Site); string password = Common.GetConfigurationPropertyValue("ReaderRoleUserPassword", this.Site); string domain = Common.GetConfigurationPropertyValue("Domain", this.Site); this.dwsAdapter.Credentials = new NetworkCredential(userName, password, domain); this.dwsAdapter.RemoveDwsUser(int.Parse(firstMember.ID), out error); this.Site.Assert.IsNotNull(error, "The response is expected to be a NoAccess error."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R22"); // Verify MS-DWSS requirement: MS-DWSS_R22 bool isVerifiedR22 = string.Equals("3", error.ID, StringComparison.CurrentCultureIgnoreCase) && error.Value == ErrorTypes.NoAccess; this.Site.CaptureRequirementIfIsTrue( isVerifiedR22, 22, @"[In Error] The value 3 [ID] matches the Error type NoAccess."); // Set default Dws service credential to admin credential. userName = Common.GetConfigurationPropertyValue("UserName", this.Site); password = Common.GetConfigurationPropertyValue("Password", this.Site); domain = Common.GetConfigurationPropertyValue("Domain", this.Site); this.dwsAdapter.Credentials = new NetworkCredential(userName, password, domain); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The response should not be an error!"); }
public void MSDWSS_S03_TC07_DeleteFolder_DeleteFolderSuccessfully() { 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(); CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); // Redirect the web service to the newly created site. this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); string folderUrl = Common.GetConfigurationPropertyValue("ValidFolderUrl", this.Site) + "_" + Common.FormatCurrentDateTime(); // If the server creates the folder successfully, then validates that the server can delete the specified folder using the DeleteFolder operation. this.dwsAdapter.CreateFolder(folderUrl, out error); this.Site.Assert.IsNull(error, "The response is expected to be a <Result/>, not an error."); string invalidFolderUrl = "MSDWSS_DocumentLibrary/MSDWSS_NotExistFolder"; this.dwsAdapter.DeleteFolder(invalidFolderUrl, out error); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R173"); // Verify MS-DWSS requirement: MS-DWSS_R173 this.Site.CaptureRequirementIfIsNull( error, 173, @"[In DeleteFolder] If the specified URL does not exist, the protocol server MUST return a Result element as specified in DeleteFolderResponse (section 3.1.4.5.2.2)."); this.dwsAdapter.DeleteFolder(folderUrl, out error); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R177"); // Verify MS-DWSS requirement: MS-DWSS_R177 this.Site.CaptureRequirementIfIsNull( error, 177, @"[In DeleteFolder] If none of the prior conditions apply, the protocol server MUST delete the folder specified in the CreateFolder element and return a Result element as specified in DeleteDwsResponse (section 3.1.4.5.2.2)."); // Delete the created folder without url. this.dwsAdapter.DeleteFolder(null, out error); this.Site.Assert.IsNotNull(error, "The server should return an error."); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); }
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!"); }
public void MSDWSS_S01_TC08_RenameDws_ValidTitle() { 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); string dwsNewTitle = Common.GetConfigurationPropertyValue("ValidTitle", Site) + "_" + Common.FormatCurrentDateTime(); this.dwsAdapter.RenameDws(dwsNewTitle, out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); Results getDwsDataRespResults = this.dwsAdapter.GetDwsData(documents.Name, string.Empty, out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R554"); // Verify MS-DWSS requirement: MS-DWSS_R554 this.Site.CaptureRequirementIfAreEqual <string>( dwsNewTitle, getDwsDataRespResults.Title, 554, @"[In GetDwsDataResponse] Title: The title of the workspace."); // Rename Document Workspace without title. this.dwsAdapter.RenameDws(null, out error); this.Site.Assert.IsNotNull(error, "The server should return an error!"); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); }
public void MSDWSS_S05_TC01_RemoveDwsUser_RemoveUserSuccessfully() { 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(); CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); // Redirect the web service to the newly created site. this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); // Get first member of the current site. Results getDwsDataRespResults = this.dwsAdapter.GetDwsData(documents.Name, string.Empty, out error); this.Site.Assert.IsNull(error, "The response is expected to be a GetDwsDataResult not an error"); this.Site.Assert.IsNotNull(getDwsDataRespResults.Members.Items, "The server should return a member element."); this.Site.Assert.IsTrue(getDwsDataRespResults.Members.Items.Length > 0, "The site members should be more than one."); Member firstMember = getDwsDataRespResults.Members.Items[0] as Member; this.Site.Assert.IsNotNull(firstMember, "The user should exist on server."); // Remove the first member. this.dwsAdapter.RemoveDwsUser(int.Parse(firstMember.ID), out error); this.Site.Assert.IsNull(error, "The response is expected to be a Result element not an error"); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The response should not be an error!"); }
public void MSDWSS_S03_TC01_CreateFolder_CreateFolderSuccessfully() { 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(); CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); // Redirect the web service to the newly created site. this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); // Create a sub folder in the web site. string folderUrl = Common.GetConfigurationPropertyValue("ValidFolderUrl", this.Site) + "_" + Common.FormatCurrentDateTime(); this.dwsAdapter.CreateFolder(folderUrl, out error); this.Site.Assert.IsNull(error, "The response is expected to be a <Result/>, not an error."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R155"); // Verify MS-DWSS requirement: MS-DWSS_R155 this.Site.CaptureRequirementIfIsNull( error, 155, @"[In CreateFolder] If none of the prior conditions [FolderNotFound, AlreadyExists, NoAccess, Failed or ServerFailure] apply, the protocol server MUST create the folder specified in the CreateFolder element."); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); }
public void MSDWSS_S01_TC09_RenameDws_NoAccess() { 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); this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); // Set Dws service credential to Reader credential. string userName = Common.GetConfigurationPropertyValue("ReaderRoleUser", this.Site); string password = Common.GetConfigurationPropertyValue("ReaderRoleUserPassword", this.Site); string domain = Common.GetConfigurationPropertyValue("Domain", this.Site); this.dwsAdapter.Credentials = new NetworkCredential(userName, password, domain); string dwsNewTitle = Common.GetConfigurationPropertyValue("ValidTitle", Site) + "_" + Common.FormatCurrentDateTime(); this.dwsAdapter.RenameDws(dwsNewTitle, out error); this.Site.Assert.IsNotNull(error, "The response is expected to be a NoAccess error."); // The precondition has verified this requirement already. this.Site.CaptureRequirement( 299, @"[In RenameDwsResponse] Error: This element is returned when an error occurs in processing."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R294"); // Verify MS-DWSS requirement: MS-DWSS_R294 this.Site.CaptureRequirementIfAreEqual <ErrorTypes>( ErrorTypes.NoAccess, error.Value, 294, @"[In RenameDws] If the user submitting the request is not authorized to change the title, the protocol server MUST return an Error element with a NoAccess code."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R22"); // Verify MS-DWSS requirement: MS-DWSS_R22 this.Site.CaptureRequirementIfAreEqual <string>( "3", error.ID, 22, @"[In Error] The value 3 [ID] matches the Error type NoAccess."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R295"); // Verify MS-DWSS requirement: MS-DWSS_R295 this.Site.CaptureRequirementIfIsTrue( string.IsNullOrEmpty(error.AccessUrl), 295, @"[In RenameDws] The Error element MUST NOT contain an AccessUrl attribute."); // Set default Dws service credential to admin credential. userName = Common.GetConfigurationPropertyValue("UserName", this.Site); password = Common.GetConfigurationPropertyValue("Password", this.Site); domain = Common.GetConfigurationPropertyValue("Domain", this.Site); this.dwsAdapter.Credentials = new NetworkCredential(userName, password, domain); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); }
public void MSDWSS_S01_TC01_CanCreateDwsUrl_ValidUrl() { this.dwsAdapter.ServiceUrl = Common.GetConfigurationPropertyValue("TestDWSSWebSite", this.Site); Error error; string dwsUrl = Common.GetConfigurationPropertyValue("SiteCollectionName", this.Site) + "_" + Common.FormatCurrentDateTime(); string createDwsUrl = this.dwsAdapter.CanCreateDwsUrl(dwsUrl, out error); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R421"); // Verify MS-DWSS requirement: MS-DWSS_R421 this.Site.CaptureRequirementIfAreEqual <string>( dwsUrl, createDwsUrl, 421, @"[In Message Processing Events and Sequencing Rules] CanCreateDwsUrl: It also returns a URL that is unique for the current site (2)."); // Create a Dws with this url, this operation should be success. CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(createDwsUrl, null, string.Empty, null, out error); this.Site.Assert.IsNull(error, "The response is expected to be an CreateDwsResult, not an error!"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R474"); // Verify MS-DWSS requirement: MS-DWSS_R474 string expectedDwsUrl = this.dwsAdapter.ServiceUrl.ToLower().Replace(Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site).ToLower(), "/" + createDwsUrl); this.Site.CaptureRequirementIfAreEqual <string>( expectedDwsUrl.ToLower(), createDwsRespResults.Url.ToLower(), 474, @"[In CreateDwsResponse] Url: URL for the new workspace."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R684"); // Verify MS-DWSS requirement: MS-DWSS_R684 // It indicate the server create the Dws successfully and returns a Results element if the createDwsRespResults is not null. this.Site.CaptureRequirementIfIsNotNull( createDwsRespResults, 684, @"[In CreateDws] The protocol server MUST create the specified Document Workspace."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R685"); // Verify MS-DWSS requirement: MS-DWSS_R685 // It indicate the server create the Dws successfully and returns a Results element if the createDwsRespResults is not null. this.Site.CaptureRequirementIfIsNotNull( createDwsRespResults, 685, @"[In CreateDws] The protocol server MUST create a CreateDwsResponse response message with a Result element."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R681"); // Verify MS-DWSS requirement: MS-DWSS_R681 // It indicate the server create the Dws successfully and returns a Results element if the createDwsRespResults is not null. this.Site.CaptureRequirementIfIsNotNull( createDwsRespResults, 681, @"[In CreateDws] The protocol server MUST return a CreateDwsResponse response message with a Result element."); 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!"); }
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 (2) with the same name already exists on the site (2) 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 (2) with the specified name already exists on this site (2). (<4> When a site (2) with the specified name already exists on this site (2), 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!"); }
public void MSDWSS_S01_TC05_CreateDws_EmptyNameAndValidTitle() { this.dwsAdapter.ServiceUrl = Common.GetConfigurationPropertyValue("TestDWSSWebSite", this.Site); Error error; string dwsTitle = Common.GetConfigurationPropertyValue("ValidTitle", Site) + "_" + Common.FormatCurrentDateTime(); // Request the web site with empty Name, non-empty and valid Title, the server creates a new web site that is based on Title. CreateDwsResultResults createDws1RespResults = this.dwsAdapter.CreateDws(string.Empty, null, dwsTitle, null, out error); this.Site.Assert.IsNull(error, "The response is expected to be a CreateDwsResult, not an error!"); // Create another DWS with the same title. CreateDwsResultResults createDws2RespResults = this.dwsAdapter.CreateDws(string.Empty, null, dwsTitle, null, out error); this.Site.Assert.IsNull(error, "The response is expected to be a CreateDwsResult, not an error!"); // Get last element string newCreatedDwsName = createDws1RespResults.Url.Substring(createDws1RespResults.Url.LastIndexOf('/') + 1); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R459"); // Verify MS-DWSS requirement: MS-DWSS_R459 this.Site.CaptureRequirementIfAreEqual <string>( dwsTitle, newCreatedDwsName, 459, @"[In CreateDws] If [name is] empty, the protocol server MUST use the title parameter as the name of the new workspace."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R465"); // Verify MS-DWSS requirement: MS-DWSS_R465 this.Site.CaptureRequirementIfAreEqual <string>( dwsTitle, newCreatedDwsName, 465, @"[In CreateDws] If the name parameter is empty, the protocol server MUST use the title parameter as the name of the new workspace when there is no site associated with that name."); // Get last element newCreatedDwsName = createDws2RespResults.Url.Substring(createDws2RespResults.Url.LastIndexOf('/') + 1); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R1466"); // Verify MS-DWSS requirement: MS-DWSS_R1466 bool isVerifiedR1466 = !string.Equals(dwsTitle, newCreatedDwsName, StringComparison.CurrentCultureIgnoreCase) && newCreatedDwsName.ToLower(CultureInfo.CurrentCulture).Contains(dwsTitle.ToLower(CultureInfo.CurrentCulture)); this.Site.CaptureRequirementIfIsTrue( isVerifiedR1466, 1466, @"[In CreateDws] If the name parameter is empty, the protocol server MUST generate a different name from the title as the name of the new workspace [if there already is a site associate with that name.]"); // Delete the new created two DWS this.dwsAdapter.ServiceUrl = createDws1RespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); this.dwsAdapter.ServiceUrl = createDws2RespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); }
public void MSDWSS_S03_TC03_CreateFolder_AlreadyExists() { 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(); CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); // Redirect the web service to the newly created site. this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); // Create a folder in a specified folder URL. string folderUrl = Common.GetConfigurationPropertyValue("ValidFolderUrl", this.Site) + "_" + Common.FormatCurrentDateTime(); this.dwsAdapter.CreateFolder(folderUrl, out error); this.Site.Assert.IsNull(error, "The response is expected to be a <Result/>, not an error."); // Create a folder using the same folder URL, then the server will return a AlreadyExists Error element. this.dwsAdapter.CreateFolder(folderUrl, out error); this.Site.Assert.IsNotNull(error, "The response is expected an error."); // If error is not null, it indicates that the server did returns an Error element as is specified. this.Site.CaptureRequirement( 159, @"[In CreateFolderResponse] Error: An Error element as specified in section 2.2.3.2."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R150"); // Verify MS-DWSS requirement: MS-DWSS_R150 this.Site.CaptureRequirementIfAreEqual <ErrorTypes>( ErrorTypes.AlreadyExists, error.Value, 150, @"[In CreateFolder] If the specified URL already exists, the protocol server MUST return an Error element with an AlreadyExists error code."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R32"); // Verify MS-DWSS requirement: MS-DWSS_R32 this.Site.CaptureRequirementIfAreEqual <string>( "13", error.ID, 32, @"[In Error] The value 13 [ID] matches the Error type AlreadyExists."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R323"); // Verify MS-DWSS requirement: MS-DWSS_R323 this.Site.CaptureRequirementIfIsTrue( string.IsNullOrEmpty(error.AccessUrl), 323, @"[In Error] This attribute [AccessUrl] MUST NOT be present when the Error element contains AlreadyExists error code."); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); }
public void MSDWSS_S05_TC02_RemoveDwsUser_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(); CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); // Redirect the web service to the newly created site. this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); int invalidUserId = -1; this.dwsAdapter.RemoveDwsUser(invalidUserId, out error); this.Site.Assert.IsNotNull(error, "The expected response is an error."); // If the error is not null, it indicates that the server returned an Error element as is specified. this.Site.CaptureRequirement( 289, @"[In RemoveDwsUserResponse] Error: An Error element as specified in section 2.2.3.2."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R286"); // Verify MS-DWSS requirement: MS-DWSS_R286 this.Site.CaptureRequirementIfAreEqual <ErrorTypes>( ErrorTypes.ServerFailure, error.Value, 286, @"[In RemoveDwsUser] If an error of any type occurs during the processing, the protocol server MUST return an Error element as specified in section 2.2.3.2 with an error code of ServerFailure."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R20"); // Verify MS-DWSS requirement: MS-DWSS_R20 this.Site.CaptureRequirementIfAreEqual <string>( "1", error.ID, 20, @"[In Error] The value 1 [ID] matches the Error type ServerFailure."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R312"); // Verify MS-DWSS requirement: MS-DWSS_R312 this.Site.CaptureRequirementIfIsTrue( string.IsNullOrEmpty(error.AccessUrl), 312, @"[In Error] This attribute [AccessUrl] MUST NOT be present when the Error element contains ServerFailure error code."); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The response should not be an error!"); }
public void MSDWSS_S01_TC12_DeleteDws_WebContainsSubwebs() { 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(); CreateDwsResultResults createDws1RespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); // Redirect the web service to the new created site. this.dwsAdapter.ServiceUrl = createDws1RespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); // create a SubSite CreateDwsResultResults createDws2RespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsTrue(error.Value == ErrorTypes.WebContainsSubwebs, "The response is expected to be a WebContainsSubwebs error."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R30"); // Verify MS-DWSS requirement: MS-DWSS_R30 this.Site.CaptureRequirementIfAreEqual <string>( "11", error.ID, 30, @"[In Error] The value 11 [ID] matches the Error type WebContainsSubwebs."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R321"); // Verify MS-DWSS requirement: MS-DWSS_R321 this.Site.CaptureRequirementIfIsTrue( string.IsNullOrEmpty(error.AccessUrl), 321, @"[In Error] This attribute [AccessUrl] MUST NOT be present when the Error element contains WebContainsSubwebs error code."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R163"); // Verify MS-DWSS requirement: MS-DWSS_R163 this.Site.CaptureRequirementIfAreEqual <ErrorTypes>( ErrorTypes.WebContainsSubwebs, error.Value, 163, @"[In DeleteDws] If the specified Document Workspace has sub sites, the protocol server MUST return an Error element with the WebContainsSubwebs error code."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R1671"); // Verify MS-DWSS requirement: MS-DWSS_R1671 // If error is not null, it indicate that the server did return an error element with a correct schema. this.Site.CaptureRequirementIfIsNotNull( error, 1671, @"[In DeleteDwsResponse] Error: An Error element as specified in section 2.2.3.2."); // Redirect the web service to the sub site. this.dwsAdapter.ServiceUrl = createDws2RespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); // Redirect the web service to the parent site. this.dwsAdapter.ServiceUrl = createDws1RespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); }
public void MSDWSS_S01_TC13_DeleteDws_NoAccess() { 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(); CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, documents, out error); this.dwsAdapter.ServiceUrl = createDwsRespResults.Url + Common.GetConfigurationPropertyValue("TestDWSSSuffix", this.Site); // Set Dws service credential to Reader credential which does not have sufficient rights. string userName = Common.GetConfigurationPropertyValue("ReaderRoleUser", this.Site); string password = Common.GetConfigurationPropertyValue("ReaderRoleUserPassword", this.Site); string domain = Common.GetConfigurationPropertyValue("Domain", this.Site); this.dwsAdapter.Credentials = new NetworkCredential(userName, password, domain); this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNotNull(error, "The response is expected to be an error."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R162"); // Verify MS-DWSS requirement: MS-DWSS_R162 this.Site.CaptureRequirementIfAreEqual <ErrorTypes>( ErrorTypes.NoAccess, error.Value, 162, @"[In DeleteDws] The protocol server MUST return an Error element with a NoAccess code if the authenticated user is not authorized to delete the Document Workspace."); // Set Dws service credential to a user who has sufficient permission to call DeleteDws operation. userName = Common.GetConfigurationPropertyValue("UserName", this.Site); password = Common.GetConfigurationPropertyValue("Password", this.Site); this.dwsAdapter.Credentials = new NetworkCredential(userName, password, domain); // Redirect the web service to the site collection without sub sites. this.dwsAdapter.ServiceUrl = Common.GetConfigurationPropertyValue("SiteCollectionWithoutSubSite", this.Site); // Try to delete the site collection. this.dwsAdapter.DeleteDws(out error); this.Site.Assert.IsNotNull(error, "The response is expected to be an error."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R499"); // Verify MS-DWSS requirement: MS-DWSS_R499 this.Site.CaptureRequirementIfAreEqual <ErrorTypes>( ErrorTypes.ServerFailure, error.Value, 499, @"[In DeleteDws] If the specified Document Workspace is the root site of the site collection, the protocol server MUST return an Error element with the ServerFailure error code."); // Redirect the web service to the created site. 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!"); }
public void MSDWSS_S01_TC04_CreateDws_EmptyNameAndEmptyTitle() { this.dwsAdapter.ServiceUrl = Common.GetConfigurationPropertyValue("TestDWSSWebSite", this.Site); Error error; UsersItem users = new UsersItem(); // construct an invalid user users.Name = "invalidUser"; users.Email = "invalidUserEmail"; CreateDwsResultResults createDwsRespResults = this.dwsAdapter.CreateDws(string.Empty, users, string.Empty, null, out error); this.Site.Assert.IsNull(error, "The response is expected to be a CreateDwsResult, not an error!"); // Get last element string newCreatedDwsName = createDwsRespResults.Url.Substring(createDwsRespResults.Url.LastIndexOf('/') + 1); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R467, the new unique GUID server generated is {0}.", newCreatedDwsName); Guid dwsName; // Verify MS-DWSS requirement: MS-DWSS_R467 this.Site.CaptureRequirementIfIsTrue( Guid.TryParse(newCreatedDwsName, out dwsName), 467, @"[In CreateDws] If the name and title parameters are empty, the protocol server MUST generate a new unique GUID to use as the name of the new workspace."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R475"); // Verify MS-DWSS requirement: MS-DWSS_R475 Uri listUri; bool isVerifiedR475 = Uri.TryCreate(createDwsRespResults.DoclibUrl, UriKind.Relative, out listUri); this.Site.CaptureRequirementIfIsTrue( isVerifiedR475, 475, @"[In CreateDwsResponse] DoclibUrl: Site-relative URL for the shared documents list (1) associated with the workspace."); // Get the title of the parent site. Results getDwsDataRespResults = this.dwsAdapter.GetDwsData(string.Empty, string.Empty, out error); this.Site.Assert.IsNull(error, "The server should not return an error!"); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R476"); // Verify MS-DWSS requirement: MS-DWSS_R476 this.Site.CaptureRequirementIfAreEqual <string>( getDwsDataRespResults.Title, createDwsRespResults.ParentWeb, 476, @"[In CreateDwsResponse] ParentWeb: Title of the site (2) on which the workspace is created."); this.Site.Assert.IsNotNull(createDwsRespResults.FailedUsers, "The server should return the FailedUsers element."); this.Site.Assert.IsTrue(createDwsRespResults.FailedUsers.Length > 0, "The failed users is expected to be more than one."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R478"); // Verify MS-DWSS requirement: MS-DWSS_R478 this.Site.CaptureRequirementIfAreEqual <string>( users.Email, createDwsRespResults.FailedUsers[0].User.Email, 478, @"[In CreateDwsResponse] FailedUsers: A list of users from the CreateDws Users field that could not be added to the list of authorized users in the new workspace."); // Add the debug information this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-DWSS_R479"); // Verify MS-DWSS requirement: MS-DWSS_R479 Uri addUsersUrl; bool isVerifiedR479 = Uri.TryCreate(createDwsRespResults.AddUsersUrl, UriKind.Absolute, out addUsersUrl); this.Site.CaptureRequirementIfIsTrue( isVerifiedR479, 479, @"[In CreateDwsResponse] AddUsersUrl: An absolute URL to a Web page that provides the ability to add users to the workspace."); 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!"); }