/// <summary> /// This operation is used to get the Title, URL, Description, Language, and theme properties of the specified site. /// </summary> /// <param name="webUrl">WebUrl is a string that contains the absolute URL of the site.</param> /// <returns>The result of GetWeb.</returns> public GetWebResponseGetWebResult GetWeb(string webUrl) { GetWebResponseGetWebResult getWebResult = new GetWebResponseGetWebResult(); try { getWebResult = this.service.GetWeb(webUrl); // Capture requirements of WebDefinition complex type. if (getWebResult.Web != null) { this.ValidateWebDefinition(getWebResult.Web); } // Capture requirements of GetWeb operation. this.ValidateGetWeb(getWebResult); this.CaptureTransportRelatedRequirements(); return(getWebResult); } catch (SoapException exp) { // Capture requirements of detail complex type. this.ValidateDetail(exp.Detail); this.CaptureTransportRelatedRequirements(); throw; } }
public void MSWEBSS_S09_TC09_GetWebDefinition() { string webUrl = Common.GetConfigurationPropertyValue("SubSiteUrl", this.Site); GetWebResponseGetWebResult getWebResult = Adapter.GetWeb(webUrl); bool isVerifiedWebResult = false; string titleOfTest = Common.GetConfigurationPropertyValue("TestSiteTitle", this.Site); if (getWebResult.Web.Title.Equals(titleOfTest, StringComparison.OrdinalIgnoreCase)) { isVerifiedWebResult = true; } // Verify MS-WEBSS requirement: MS-WEBSS_R857 Site.CaptureRequirementIfIsTrue( isVerifiedWebResult, 857, @"[In WebDefinition] Title: Specifies the title of the site."); bool isVerified693 = false; if (getWebResult.Web.Url.Equals(webUrl, StringComparison.OrdinalIgnoreCase)) { isVerified693 = true; } // Verify MS-WEBSS requirement: MS-WEBSS_R693 Site.CaptureRequirementIfIsTrue( isVerified693, 693, @"[In WebDefinition] Url: Specifies the absolute URL of the site."); // Verify MS-WEBSS requirement: MS-WEBSS_R694 bool isVerifiedR694 = false; string testSiteDescription = Common.GetConfigurationPropertyValue("TestSiteDescription", this.Site); if (getWebResult.Web.Description.Equals(testSiteDescription, StringComparison.OrdinalIgnoreCase)) { isVerifiedR694 = true; } Site.CaptureRequirementIfIsTrue( isVerifiedR694, 694, @"[In WebDefinition] Description: Specifies the description of the site."); // Verify MS-WEBSS requirement: MS-WEBSS_R695 string testSiteLanguage = Common.GetConfigurationPropertyValue("TestSiteLanguage", this.Site); Site.CaptureRequirementIfAreEqual <string>( testSiteLanguage, getWebResult.Web.Language, 695, @"[In WebDefinition] Language: Specifies the language code identifier (LCID) for the language of the site."); }
public void MSWEBSS_S09_TC02_GetWeb_Succeed() { string webUrl = Common.GetConfigurationPropertyValue("SubSiteUrl", this.Site); GetWebResponseGetWebResult getWebResult = Adapter.GetWeb(webUrl); Site.Assert.IsTrue( getWebResult.Web.Title.Equals(Common.GetConfigurationPropertyValue("TestSiteTitle", this.Site), StringComparison.CurrentCultureIgnoreCase), "The web title is {0}", getWebResult.Web.Title); Site.Assert.IsTrue( getWebResult.Web.Url.Equals(webUrl, StringComparison.OrdinalIgnoreCase), "The web URL is {0}", getWebResult.Web.Url); Site.Assert.IsTrue( getWebResult.Web.Description.Equals(Common.GetConfigurationPropertyValue("TestSiteDescription", this.Site), StringComparison.OrdinalIgnoreCase), "The web description is {0}", getWebResult.Web.Description); Site.Assert.IsTrue( getWebResult.Web.Language.Equals(Common.GetConfigurationPropertyValue("TestSiteLanguage", this.Site), StringComparison.OrdinalIgnoreCase), "The web Language is {0}", getWebResult.Web.Language); // Verify MS-WEBSS requirement: MS-WEBSS_R347 bool isVerifiedGetWeb = false; bool titleOfTest = getWebResult.Web.Title.Equals(Common.GetConfigurationPropertyValue("TestSiteTitle", this.Site), StringComparison.OrdinalIgnoreCase); bool testSiteDescription = getWebResult.Web.Description.Equals(Common.GetConfigurationPropertyValue("TestSiteDescription", this.Site), StringComparison.OrdinalIgnoreCase); bool testSiteLanguage = getWebResult.Web.Language.Equals(Common.GetConfigurationPropertyValue("TestSiteLanguage", this.Site), StringComparison.OrdinalIgnoreCase); bool webURL = getWebResult.Web.Url.Equals(webUrl, StringComparison.OrdinalIgnoreCase); bool theme = getWebResult.Web.Theme == null || getWebResult.Web.Theme != null; isVerifiedGetWeb = titleOfTest && testSiteDescription && testSiteLanguage && webURL && theme; Site.CaptureRequirementIfIsTrue( isVerifiedGetWeb, 347, @"[In GetWeb] If the operation succeeds, the protocol server MUST return the title, URL, description, language, and theme properties of the specified site."); // Verify MS-WEBSS requirement: MS-WEBSS_R950 Site.CaptureRequirementIfIsTrue( isVerifiedGetWeb, 950, @"[In Messages] [Message] GetWebSoapOut [Description] The response to the request for the title, URL, description, language, and theme of the specified site (2)."); // Verify MS-WEBSS requirement: MS-WEBSS_R353 Site.CaptureRequirementIfIsTrue( isVerifiedGetWeb, 353, @"[In GetWebSoapOut] This[GetWebSoapOut] message is the response containing the title, URL, description, language, and theme of the specified site."); }
public void MSWEBSS_S09_TC10_GetWebResponseWithValidXml() { string webUrl = Common.GetConfigurationPropertyValue("SubSiteUrl", this.Site); GetWebResponseGetWebResult getWebResult = Adapter.GetWeb(webUrl); // Verify MS-WEBSS requirement: MS-WEBSS_R361 bool isVerifiedWebResult = false; if (getWebResult.Web != null) { isVerifiedWebResult = true; } Site.CaptureRequirementIfIsTrue( isVerifiedWebResult, 361, @"[In GetWebResponse] GetWebResult: An XML element that contains a Web element."); // Verify MS-WEBSS requirement: MS-WEBSS_R362 Site.CaptureRequirementIfIsTrue( isVerifiedWebResult, 362, @"[In GetWebResponse] Web: The structure of this element is defined in WebDefinition (section 2.2.4.2)."); }
/// <summary> /// This method is used to capture requirements of GetWeb operation. /// </summary> /// <param name="getWebResult">The result of the operation.</param> private void ValidateGetWeb(GetWebResponseGetWebResult getWebResult) { // Proxy handles operation's SoapIn and SoapOut, if the server didn't respond the SoapOut message for the operation, Proxy will fail. // Proxy didn't fail now, that indicates server responds corresponding SoapOut message for the operation.So the requirement be captured. // Verify MS-WEBSS requirement: MS-WEBSS_R344 Site.CaptureRequirementIfAreEqual<ValidationResult>( ValidationResult.Success, SchemaValidation.ValidationResult, 344, @"[In GetWeb] This[GetWeb] operation is defined as follows: <wsdl:operation name=""GetWeb""> <wsdl:input message=""tns:GetWebSoapIn"" /> <wsdl:output message=""tns:GetWebSoapOut"" /> </wsdl:operation>"); // Verify MS-WEBSS requirement: MS-WEBSS_R345 Site.CaptureRequirementIfAreEqual<ValidationResult>( ValidationResult.Success, SchemaValidation.ValidationResult, 345, @"[In GetWeb] The protocol client sends a GetWebSoapIn request message, and the protocol server responds with a GetWebSoapOut response message."); // Verify MS-WEBSS requirement: MS-WEBSS_R348 // COMMENT: If the actual Language value is contained in the expected domain of allowed // LCID values, then the requirement can be captured. // Ensure the SOAP result is returned successfully. Site.Assume.IsNotNull(getWebResult, "The result of GetWeb operation must not be null."); string[] lcidValues = { ((uint)LCID_Values.Afrikaans).ToString(), ((uint)LCID_Values.Albanian).ToString(), ((uint)LCID_Values.Arabic_Algeria).ToString(), ((uint)LCID_Values.Arabic_Bahrain).ToString(), ((uint)LCID_Values.Arabic_Egypt).ToString(), ((uint)LCID_Values.Arabic_Iraq).ToString(), ((uint)LCID_Values.Arabic_Jordan).ToString(), ((uint)LCID_Values.Arabic_Kuwait).ToString(), ((uint)LCID_Values.Arabic_Lebanon).ToString(), ((uint)LCID_Values.Arabic_Libya).ToString(), ((uint)LCID_Values.Arabic_Morocco).ToString(), ((uint)LCID_Values.Arabic_Oman).ToString(), ((uint)LCID_Values.Arabic_Qatar).ToString(), ((uint)LCID_Values.Arabic_Saudi_Arabia).ToString(), ((uint)LCID_Values.Arabic_Syria).ToString(), ((uint)LCID_Values.Arabic_Tunisia).ToString(), ((uint)LCID_Values.Arabic_United_Arab_Emirates).ToString(), ((uint)LCID_Values.Arabic_Yemen).ToString(), ((uint)LCID_Values.Armenian).ToString(), ((uint)LCID_Values.Azeri_Cyrillic).ToString(), ((uint)LCID_Values.Azeri_Latin).ToString(), ((uint)LCID_Values.Basque).ToString(), ((uint)LCID_Values.Belarusian).ToString(), ((uint)LCID_Values.Bulgarian).ToString(), ((uint)LCID_Values.Catalan).ToString(), ((uint)LCID_Values.Chinese_China).ToString(), ((uint)LCID_Values.Chinese_Hong_Kong_SAR).ToString(), ((uint)LCID_Values.Chinese_Macau_SAR).ToString(), ((uint)LCID_Values.Chinese_Singapore).ToString(), ((uint)LCID_Values.Chinese_Taiwan).ToString(), ((uint)LCID_Values.Croatian).ToString(), ((uint)LCID_Values.Czech).ToString(), ((uint)LCID_Values.Danish).ToString(), ((uint)LCID_Values.Dutch_Belgium).ToString(), ((uint)LCID_Values.Dutch_Netherlands).ToString(), ((uint)LCID_Values.English_Australia).ToString(), ((uint)LCID_Values.English_Belize).ToString(), ((uint)LCID_Values.English_Canada).ToString(), ((uint)LCID_Values.English_Caribbean).ToString(), ((uint)LCID_Values.English_Great_Britain).ToString(), ((uint)LCID_Values.English_Ireland).ToString(), ((uint)LCID_Values.English_Jamaica).ToString(), ((uint)LCID_Values.English_New_Zealand).ToString(), ((uint)LCID_Values.English_Philippines).ToString(), ((uint)LCID_Values.English_Southern_Africa).ToString(), ((uint)LCID_Values.English_Trinidad).ToString(), ((uint)LCID_Values.English_United_States).ToString(), ((uint)LCID_Values.Estonian).ToString(), ((uint)LCID_Values.Faroese).ToString(), ((uint)LCID_Values.Farsi).ToString(), ((uint)LCID_Values.Finnish).ToString(), ((uint)LCID_Values.French_Belgium).ToString(), ((uint)LCID_Values.French_Canada).ToString(), ((uint)LCID_Values.French_France).ToString(), ((uint)LCID_Values.French_Luxembourg).ToString(), ((uint)LCID_Values.French_Switzerland).ToString(), ((uint)LCID_Values.FYRO_Macedonia).ToString(), ((uint)LCID_Values.Gaelic_Ireland).ToString(), ((uint)LCID_Values.Gaelic_Scotland).ToString(), ((uint)LCID_Values.German_Austria).ToString(), ((uint)LCID_Values.German_Germany).ToString(), ((uint)LCID_Values.German_Liechtenstein).ToString(), ((uint)LCID_Values.German_Luxembourg).ToString(), ((uint)LCID_Values.German_Switzerland).ToString(), ((uint)LCID_Values.Greek).ToString(), ((uint)LCID_Values.Hebrew).ToString(), ((uint)LCID_Values.Hindi).ToString(), ((uint)LCID_Values.Hungarian).ToString(), ((uint)LCID_Values.Icelandic).ToString(), ((uint)LCID_Values.Indonesian).ToString(), ((uint)LCID_Values.Italian_Italy).ToString(), ((uint)LCID_Values.Italian_Switzerland).ToString(), ((uint)LCID_Values.Japanese).ToString(), ((uint)LCID_Values.Korean).ToString(), ((uint)LCID_Values.Latvian).ToString(), ((uint)LCID_Values.Lithuanian).ToString(), ((uint)LCID_Values.Malay_Brunei).ToString(), ((uint)LCID_Values.Malay_Malaysia).ToString(), ((uint)LCID_Values.Maltese).ToString(), ((uint)LCID_Values.Marathi).ToString(), ((uint)LCID_Values.Norwegian_Bokml).ToString(), ((uint)LCID_Values.Norwegian_Nynorsk).ToString(), ((uint)LCID_Values.Polish).ToString(), ((uint)LCID_Values.Portuguese_Brazil).ToString(), ((uint)LCID_Values.Portuguese_Portugal).ToString(), ((uint)LCID_Values.Raeto_Romance).ToString(), ((uint)LCID_Values.Romanian_Republic_of_Moldova).ToString(), ((uint)LCID_Values.Romanian_Romania).ToString(), ((uint)LCID_Values.Russian).ToString(), ((uint)LCID_Values.Russian_Republic_of_Moldova).ToString(), ((uint)LCID_Values.Sanskrit).ToString(), ((uint)LCID_Values.Serbian_Cyrillic).ToString(), ((uint)LCID_Values.Serbian_Latin).ToString(), ((uint)LCID_Values.Setswana).ToString(), ((uint)LCID_Values.Slovak).ToString(), ((uint)LCID_Values.Slovenian).ToString(), ((uint)LCID_Values.Sorbian).ToString(), ((uint)LCID_Values.Southern_Sotho).ToString(), ((uint)LCID_Values.Spanish_Argentina).ToString(), ((uint)LCID_Values.Spanish_Bolivia).ToString(), ((uint)LCID_Values.Spanish_Chile).ToString(), ((uint)LCID_Values.Spanish_Colombia).ToString(), ((uint)LCID_Values.Spanish_Costa_Rica).ToString(), ((uint)LCID_Values.Spanish_Dominican_Republic).ToString(), ((uint)LCID_Values.Spanish_Ecuador).ToString(), ((uint)LCID_Values.Spanish_El_Salvador).ToString(), ((uint)LCID_Values.Spanish_Guatemala).ToString(), ((uint)LCID_Values.Spanish_Honduras).ToString(), ((uint)LCID_Values.Spanish_Mexico).ToString(), ((uint)LCID_Values.Spanish_Nicaragua).ToString(), ((uint)LCID_Values.Spanish_Panama).ToString(), ((uint)LCID_Values.Spanish_Paraguay).ToString(), ((uint)LCID_Values.Spanish_Peru).ToString(), ((uint)LCID_Values.Spanish_Puerto_Rico).ToString(), ((uint)LCID_Values.Spanish_Spain_Traditional).ToString(), ((uint)LCID_Values.Spanish_Uruguay).ToString(), ((uint)LCID_Values.Spanish_Venezuela).ToString(), ((uint)LCID_Values.Swahili).ToString(), ((uint)LCID_Values.Swedish_Finland).ToString(), ((uint)LCID_Values.Swedish_Sweden).ToString(), ((uint)LCID_Values.Tamil).ToString(), ((uint)LCID_Values.Tatar).ToString(), ((uint)LCID_Values.Thai).ToString(), ((uint)LCID_Values.Tsonga).ToString(), ((uint)LCID_Values.Turkish).ToString(), ((uint)LCID_Values.Ukrainian).ToString(), ((uint)LCID_Values.Urdu).ToString(), ((uint)LCID_Values.Uzbek_Cyrillic).ToString(), ((uint)LCID_Values.Uzbek_Latin).ToString(), ((uint)LCID_Values.Vietnamese).ToString(), ((uint)LCID_Values.Xhosa).ToString(), ((uint)LCID_Values.Yiddish).ToString(), ((uint)LCID_Values.Zulu).ToString() }; bool isVerifiedR348 = false; List<string> lcidDomain = new List<string>(lcidValues); if (lcidDomain.Contains(getWebResult.Web.Language)) { isVerifiedR348 = true; } else { Site.Assert.Fail("lcidDomain doesn't contain web language {0}", getWebResult.Web.Language); } Site.CaptureRequirementIfIsTrue( isVerifiedR348, 348, @"[In GetWeb] The Language property MUST include an LCID value."); // Verify MS-WEBSS requirement: MS-WEBSS_R355 Site.CaptureRequirementIfIsTrue( this.HasElement(SchemaValidation.LastRawResponseXml, "GetWebResponse"), 355, @"[In GetWebSoapOut] The SOAP body contains a GetWebResponse element."); // Verify MS-WEBSS requirement: MS-WEBSS_R360 Site.CaptureRequirementIfAreEqual<ValidationResult>( ValidationResult.Success, SchemaValidation.ValidationResult, 360, @"[In GetWebResponse] The SOAP body contains a GetWebResponse element, which has the following definition: <s:element name=""GetWebResponse""> <s:complexType> <s:sequence> <s:element name=""GetWebResult"" minOccurs=""1""> <s:complexType> <s:sequence> <s:element name=""Web"" type=""tns:WebDefinition""/> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element>"); }
/// <summary> /// This operation is used to get the Title, URL, Description, Language, and theme properties of the specified site. /// </summary> /// <param name="webUrl">WebUrl is a string that contains the absolute URL of the site.</param> /// <returns>The result of GetWeb.</returns> public GetWebResponseGetWebResult GetWeb(string webUrl) { GetWebResponseGetWebResult getWebResult = new GetWebResponseGetWebResult(); try { getWebResult = this.service.GetWeb(webUrl); // Capture requirements of WebDefinition complex type. if (getWebResult.Web != null) { this.ValidateWebDefinition(getWebResult.Web); } // Capture requirements of GetWeb operation. this.ValidateGetWeb(getWebResult); this.CaptureTransportRelatedRequirements(); return getWebResult; } catch (SoapException exp) { // Capture requirements of detail complex type. this.ValidateDetail(exp.Detail); this.CaptureTransportRelatedRequirements(); throw; } }