public void MSWEBSS_S05_TC02_GetObjectIdFromUrl_ValidListItemUrl() { this.Site.Assume.IsTrue(Common.IsRequirementEnabled(1032, this.Site), "The test case is executed only the property 'R1032Enabled' is true."); GetObjectIdFromUrlResponseGetObjectIdFromUrlResult getObjectIdFromUrlResult = Adapter.GetObjectIdFromUrl(Common.GetConfigurationPropertyValue("GetObjectIdFromUrl_ListItemUrl", this.Site)); // If the product is Microsoft SharePoint Foundation 2010 and above, Verify MS-WEBSS requirement: MS-WEBSS_R1032 when invokes the operation "GetObjectIdFromUrl" successfully. Site.CaptureRequirement( 1032, @"[In Appendix B: Product Behavior] Implementation does support this[GetObjectIdFromUrl] operation.(<16>Microsoft SharePoint Foundation 2010 and above follow this behavior.)"); #region Capture ListItem Related Requirement // Verify MS-WEBSS requirement: MS-WEBSS_R313 // If the specified URL corresponds to an object on the site (2), use that object as input parameter. // the server can respond correctly. Site.CaptureRequirementIfIsNotNull( getObjectIdFromUrlResult, 313, @"[In GetObjectIdFromUrl] If the specified URL corresponds to an object on the site, use that object."); // Verify MS-WEBSS requirement: MS-WEBSS_R335 string listItemId = SutAdapter.GetObjectId(Common.GetConfigurationPropertyValue("webSiteName", this.Site), "listItem"); BaseTestSite.Assert.IsNotNull(listItemId, "This value of the list item should be non-empty"); Site.CaptureRequirementIfAreEqual <string>( listItemId, getObjectIdFromUrlResult.ObjectId.ListItemId, 335, @"[In GetObjectIdFromUrlResponse] ObjectId.ListItemId: If the object is a list item, the value of the attribute[ObjectId.ListItemId] MUST be the identifier of the list item."); #endregion }
public void MSWEBSS_S10_TC04_GetActivatedFeaturesResponseWithCommaDelimitedGUID() { Adapter.InitializeService(UserAuthentication.Authenticated); string activatedFeatures = Adapter.GetActivatedFeatures(); // Get the GUIDs of the features on the site. string webSiteName = Common.GetConfigurationPropertyValue("webSiteName", this.Site); string strFeature = SutAdapter.GetObjectId(webSiteName, FeaturesPosition.SiteFeatures); Site.Assert.IsNotNull(strFeature, "This value of the feature id should be non-empty"); // Get the GUIDs of the features on the parent site collection. strFeature = SutAdapter.GetObjectId(webSiteName, FeaturesPosition.SiteCollectionFeatures); Site.Assert.IsNotNull(strFeature, "This value of the feature id should be non-empty"); char[] commaSeparators = new char[] { (char)CONST_CHARS.Comma }; string[] activatedFeaturesList = activatedFeatures.Split(commaSeparators, StringSplitOptions.RemoveEmptyEntries); foreach (string s in activatedFeaturesList) { Guid id; Site.Assert.IsTrue(Guid.TryParse(s, out id), "The substring should be a GUID."); } // Verify MS-WEBSS requirement: MS-WEBSS_R132 bool isVerifiedR132 = false; if (activatedFeatures.Contains(",")) { isVerifiedR132 = true; } Site.CaptureRequirementIfIsTrue( isVerifiedR132, 132, @"[In GetActivatedFeaturesSoapOut] It[GetActivatedFeaturesSoapOut] consists of a string consisting of a comma-delimited list of GUIDs, where each GUID identifies a feature activated in the site (2) or the site collection."); }
public void MSWEBSS_S10_TC02_GetActivatedFeatures_Succeed() { Adapter.InitializeService(UserAuthentication.Authenticated); string activatedFeatures = Adapter.GetActivatedFeatures(); // Get the GUIDs of the features on the site. string webSiteName = Common.GetConfigurationPropertyValue("webSiteName", this.Site); string strFeaturesId = SutAdapter.GetObjectId(webSiteName, FeaturesPosition.SiteFeatures); Site.Assert.IsNotNull(strFeaturesId, "This value of the feature id should be non-empty"); string siteFeatures = strFeaturesId.Remove(0, 1).Replace( (char)CONST_CHARS.Blank, (char)CONST_CHARS.Comma); // Get the GUIDs of the features on the parent site collection. strFeaturesId = SutAdapter.GetObjectId(webSiteName, FeaturesPosition.SiteCollectionFeatures); Site.Assert.IsNotNull(strFeaturesId, "This value of the feature id should be non-empty"); string siteCollectionFeatures = strFeaturesId.Remove(0, 1).Replace( (char)CONST_CHARS.Blank, (char)CONST_CHARS.Comma); char[] commaSeparators = new char[] { (char)CONST_CHARS.Comma }; string[] activatedFeaturesList = activatedFeatures.Split( commaSeparators, StringSplitOptions.RemoveEmptyEntries); string[] siteFeaturesList = siteFeatures.Split( commaSeparators, StringSplitOptions.RemoveEmptyEntries); string[] siteCollectionFeaturesList = siteCollectionFeatures.Split( commaSeparators, StringSplitOptions.RemoveEmptyEntries); foreach (string s in activatedFeaturesList) { Guid id; Site.Assert.IsTrue(Guid.TryParse(s, out id), "The substring should be a GUID."); } // Verify MS-WEBSS requirement: MS-WEBSS_R125 // COMMENT: If all the substrings split from the result of the operation can be initialized // as a GUID, which means the substrings are GUID; and also the comma-delimited list // of GUIDs of the activated features on the site can be found in the result of the operation, // then the following requirement can be captured. bool isVerifiedR125 = false; foreach (string s in siteFeaturesList) { if (activatedFeatures.Contains(s)) { isVerifiedR125 = true; } } Site.CaptureRequirementIfIsTrue( isVerifiedR125, 125, @"[In GetActivatedFeatures] The GetActivatedFeaturesResponse element MUST contain a single string, formatted as a comma-delimited list of GUIDs, each identifying an activated feature on the site (2)."); // Verify MS-WEBSS requirement: MS-WEBSS_R806 // COMMENT: If all the substrings split from the result of the operation can be initialized // as a GUID, which means the substrings are GUID; and also the comma-delimited list // of GUIDs of the activated features on the site collection can be found in the result of // the operation, then the following requirement can be captured. bool isVerifiedR806 = false; foreach (string s in siteCollectionFeaturesList) { if (activatedFeatures.Contains(s)) { isVerifiedR806 = true; } } Site.CaptureRequirementIfIsTrue( isVerifiedR806, 806, @"[In GetActivatedFeatures] The GetActivatedFeaturesResponse element MUST contain a single string, formatted as a comma-delimited list of GUIDs, each identifying an activated feature in the site collection."); // Verify MS-WEBSS requirement: MS-WEBSS_R127 // COMMENT: If all the substrings split from the result of the operation can be initialized // as a GUID, which means the substrings are GUID; and also the comma-delimited list of // GUIDs of the activated features on the site followed by the comma-delimited list of // GUIDs of the activated features on the site collection can be found in the result of the // operation, then the following requirement can be captured. Site.CaptureRequirementIfIsTrue( isVerifiedR806 && isVerifiedR125, 127, @"[In GetActivatedFeatures] The value of GetActivatedFeaturesResult MUST be a comma-delimited list of GUIDs of features activated on the site (2), followed by a comma-delimited list of GUIDs of features activated on the parent site collection."); // Verify MS-WEBSS requirement: MS-WEBSS_R137,MS-WEBSS_R138 // COMMENT: If all the substrings split from the result of the operation can be initialized // as a GUID, which means the substrings are GUID; and also the comma-delimited list of // GUIDs of the activated features on the site followed by the comma-delimited list of // GUIDs of the activated features on the site collection can be found in the result of the // operation, then the following requirement can be captured. Site.CaptureRequirementIfIsTrue( isVerifiedR806 && isVerifiedR125, 137, @"[In GetActivatedFeaturesResponse] GetActivatedFeaturesResult: A comma-delimited list of GUIDs, where each GUID is formatted as a UniqueIdentifierWithoutBraces as specified in [MS-WSSCAML] section 2.1.15."); Site.CaptureRequirementIfIsTrue( isVerifiedR806 && isVerifiedR125, 138, @"[In GetActivatedFeaturesResponse] The list MUST include one GUID identifying every feature activated on the site, a tab character followed by one GUID identifying every feature activated in the site collection."); }
public void MSWEBSS_S05_TC01_GetObjectIdFromUrl_ValidListUrl() { this.Site.Assume.IsTrue(Common.IsRequirementEnabled(1032, this.Site), "The test case is executed only when the property 'R1032Enabled' is true."); GetObjectIdFromUrlResponseGetObjectIdFromUrlResult getObjectIdFromUrlResult = Adapter.GetObjectIdFromUrl(Common.GetConfigurationPropertyValue("GetObjectIdFromUrl_ListUrl", this.Site)); GetObjectIdFromUrlResponseGetObjectIdFromUrlResult getObjectItemIdFromUrlResult = Adapter.GetObjectIdFromUrl(Common.GetConfigurationPropertyValue("GetObjectIdFromUrl_ListItemUrl", this.Site)); // If the product is Microsoft SharePoint Foundation 2010 and above, Verify MS-WEBSS requirement: MS-WEBSS_R1032 when invokes the operation "GetObjectIdFromUrl" successfully. Site.CaptureRequirement( 1032, @"[In Appendix B: Product Behavior] Implementation does support this[GetObjectIdFromUrl] operation.(<16>Microsoft SharePoint Foundation 2010 and above follow this behavior.)"); #region Capture List Related Requirement // Verify MS-WEBSS requirement: MS-WEBSS_R328 MS-WEBSS_R328001 string webSiteName = SutAdapter.GetObjectId(Common.GetConfigurationPropertyValue("webSiteName", this.Site), "list"); Site.Assert.IsNotNull(webSiteName, "This value of the list id should be non-empty"); string exceptedId = "{" + webSiteName + "}"; Site.CaptureRequirementIfAreEqual <string>( exceptedId, getObjectIdFromUrlResult.ObjectId.ListId.ToString(), 328, @"[In GetObjectIdFromUrlResponse] ObjectId.ListId: If the object is a list, the value of the attribute MUST be the list identifier."); Site.CaptureRequirementIfAreEqual <string>( exceptedId, getObjectItemIdFromUrlResult.ObjectId.ListId.ToString(), 328001, @"[In GetObjectIdFromUrlResponse] ObjectId.ListId: If the object is a list item, the value of the attribute MUST be the list identifier."); // Verify MS-WEBSS requirement: MS-WEBSS_R1043, MS-WEBSS_R1045001001 // The type of List Server Template, the values are gotten according to [MS-WSSFO] section 2.2.3.12. string listServerTemplateValues = "-1,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,130,140,150,200,201,202,204,207,210,211,212,301,302,303,1100,1200"; bool isListServerTemplateSpecifiedInMswssfo = listServerTemplateValues.Contains(getObjectIdFromUrlResult.ObjectId.ListServerTemplate.ToString()); bool isListItemServerTemplateSpecifiedInMswssfo = listServerTemplateValues.Contains(getObjectItemIdFromUrlResult.ObjectId.ListServerTemplate.ToString()); Site.CaptureRequirementIfIsTrue( isListServerTemplateSpecifiedInMswssfo, 1043, @"[In GetObjectIdFromUrlResponse] ObjectId.ListServerTemplate: If the object is a list, the value of the attribute MUST be one of the list template types as specified in [MS-WSSFO2] section 2.2.3.12 [the value of the list template type is 100]."); Site.CaptureRequirementIfIsTrue( isListServerTemplateSpecifiedInMswssfo, 1045001001, @"[In GetObjectIdFromUrlResponse] ObjectId.ListServerTemplate: If the object is a list item, the value of the attribute MUST be one of the list template types as specified in [MS-WSSFO2] section 2.2.3.12 [the value of the list template type is 100]."); // The values of List Base Type, the values are gotten according to [MS-WSSFO] section 2.2.3.11. string listBaseTypeValues = "0,1,3,4,5"; bool isListBaseTypeSpecifiedInMswssfo = listBaseTypeValues.Contains(getObjectIdFromUrlResult.ObjectId.ListBaseType.ToString()); bool isListItemBaseTypeSpecifiedInMswssfo = listBaseTypeValues.Contains(getObjectItemIdFromUrlResult.ObjectId.ListBaseType.ToString()); // Verify MS-WEBSS requirement: MS-WEBSS_R1044 Site.CaptureRequirementIfIsTrue( isListBaseTypeSpecifiedInMswssfo, 1044, @"[In GetObjectIdFromUrlResponse] ObjectId.ListBaseType: If the object is a list, the value of the attribute MUST be one of the List Base Types as specified in [MS-WSSFO2] section 2.2.3.11 [the value of the List Base Type is 1]."); // Verify MS-WEBSS requirement: MS-WEBSS_R1046001001 Site.CaptureRequirementIfIsTrue( isListItemBaseTypeSpecifiedInMswssfo, 1046001001, @"[In GetObjectIdFromUrlResponse] ObjectId.ListBaseType: If the object is a list item, the value of the attribute MUST be one of the List Base Types as specified in [MS-WSSFO2] section 2.2.3.11 [the value of the List Base Type is 1]."); bool isVerifiedR334 = false; if (getObjectIdFromUrlResult.ObjectId.ListItem.ToLower().Equals("false", StringComparison.OrdinalIgnoreCase)) { isVerifiedR334 = true; Site.Assert.AreEqual("false", getObjectIdFromUrlResult.ObjectId.ListItem.ToLower(), "It is expected to get false, since this is not a list item."); } // Verify MS-WEBSS requirement: MS-WEBSS_R334 Site.CaptureRequirementIfIsTrue( isVerifiedR334, 334, @"[In GetObjectIdFromUrlResponse] ObjectId.ListItem: Specifies whether the object is a list item."); // Verify MS-WEBSS requirement: MS-WEBSS_R336 bool isVerifiedR336 = false; if (getObjectIdFromUrlResult.ObjectId.ListItemId == null) { isVerifiedR336 = true; } Site.CaptureRequirementIfIsTrue( isVerifiedR336, 336, @"[In GetObjectIdFromUrlResponse] Otherwise[If the object is not a list item], the attribute MUST NOT be present."); // Verify MS-WEBSS requirement: MS-WEBSS_R337 bool isVerifiedR337 = false; if (getObjectIdFromUrlResult.ObjectId.File.ToLower().Equals("true", StringComparison.OrdinalIgnoreCase)) { isVerifiedR337 = true; } Site.CaptureRequirementIfIsTrue( isVerifiedR337, 337, @"[In GetObjectIdFromUrlResponse] ObjectId.File: Specifies whether the object is a file."); // Verify MS-WEBSS requirement: MS-WEBSS_R338 bool isVerifiedR338 = false; if (getObjectIdFromUrlResult.ObjectId.Folder.ToLower().Equals("false", StringComparison.OrdinalIgnoreCase)) { isVerifiedR338 = true; Site.Assert.AreEqual("false", getObjectIdFromUrlResult.ObjectId.Folder.ToLower(), "It is expected to get false, since this is not a folder."); } Site.CaptureRequirementIfIsTrue( isVerifiedR338, 338, @"[In GetObjectIdFromUrlResponse] ObjectId.Folder: Specifies whether the object is a folder."); // Verify MS-WEBSS requirement: MS-WEBSS_R719 bool isVerifiedR719 = false; string alternateUrl = getObjectIdFromUrlResult.ObjectId.AlternateUrls; string[] urlSplit = alternateUrl.Split(','); int urlNum = urlSplit.Length; string sutComputerName = Common.GetConfigurationPropertyValue("SutComputerName", this.Site); string transportType = Common.GetConfigurationPropertyValue("TransportType", this.Site); for (int i = 0; i < urlNum; i++) { if (urlSplit[i] == transportType.ToLower() + "://" + sutComputerName.ToLower() + "/") { isVerifiedR719 = true; break; } } Site.CaptureRequirementIfIsTrue( isVerifiedR719, 719, @"[In GetObjectIdFromUrlResponse] ObjectId. AlternateUrls: Alternate URLs are a comma delimited list of other possible URLs for the object."); #endregion }