Microsoft.Protocols.TestSuites.MS_VIEWSS.S04_MaintainViewProperties.MSVIEWSS_S04_TC04_UpdateViewHtml_InvalidViewName C# (CSharp) Method

MSVIEWSS_S04_TC04_UpdateViewHtml_InvalidViewName() private method

private MSVIEWSS_S04_TC04_UpdateViewHtml_InvalidViewName ( ) : void
return void
        public void MSVIEWSS_S04_TC04_UpdateViewHtml_InvalidViewName()
        {
            string listName = TestSuiteBase.ListGUID;

            UpdateViewHtmlViewProperties viewProperties = new UpdateViewHtmlViewProperties();
            UpdateViewHtmlToolbar toolbar;
            UpdateViewHtmlViewHeader viewHeader;
            UpdateViewHtmlViewBody viewBody;
            UpdateViewHtmlViewFooter viewFooter;
            UpdateViewHtmlViewEmpty viewEmpty;
            UpdateViewHtmlRowLimitExceeded rowLimitExceeded;

            this.GetHtmlConfigure(
                                out toolbar,
                                out viewHeader,
                                out viewBody,
                                out viewFooter,
                                out viewEmpty,
                                out rowLimitExceeded);

            UpdateViewHtmlQuery queryValue = new UpdateViewHtmlQuery();
            queryValue.Query = this.GetCamlQueryRootForWhere(false);

            UpdateViewHtmlViewFields updateViewFields = new UpdateViewHtmlViewFields();
            updateViewFields.ViewFields = this.GetViewFields(false);

            UpdateViewHtmlAggregations aggregations = new UpdateViewHtmlAggregations();
            this.GetAggregationsDefinition(true, true, Common.GetConfigurationPropertyValue("FieldRefAggregations_AggregationsType", this.Site));

            UpdateViewHtmlFormats formats = new UpdateViewHtmlFormats();
            formats.Formats = this.GetViewFormatDefinitions();

            UpdateViewHtmlRowLimit rowLimitValue = new UpdateViewHtmlRowLimit();
            rowLimitValue.RowLimit = this.GetAvailableRowLimitDefinition();

            bool caughtSoapException = false; 

            // Call UpdateViewHtml method with invalid viewName.
            try
            {
                Adapter.UpdateViewHtml(
                            listName,
                            this.GenerateRandomString(5),
                            viewProperties,
                            toolbar,
                            viewHeader,
                            viewBody,
                            viewFooter,
                            viewEmpty,
                            rowLimitExceeded,
                            queryValue,
                            updateViewFields,
                            aggregations,
                            formats,
                            rowLimitValue);
            }
            catch (SoapException soapException)
            {
                caughtSoapException = true;

                // If the server returns SOAP fault, then capture this requirement.
                Site.CaptureRequirementIfIsNotNull(
                    soapException,
                    22,
                    "[In viewName] If the value of viewName element is not the GUID of a list view, the operation MUST return a SOAP fault message.");
            }

            this.Site.Assert.IsTrue(caughtSoapException, "There should be a SOAP exception in the response."); 
        }