Microsoft.Protocols.TestSuites.MS_VIEWSS.S01_AddDeleteViews.MSVIEWSS_S01_TC13_AddView_InvalidType C# (CSharp) Method

MSVIEWSS_S01_TC13_AddView_InvalidType() private method

private MSVIEWSS_S01_TC13_AddView_InvalidType ( ) : void
return void
        public void MSVIEWSS_S01_TC13_AddView_InvalidType()
        {
            string listName = TestSuiteBase.ListGUID;
            string displayName = this.GenerateRandomString(5);

            AddViewViewFields viewFields = new AddViewViewFields();
            viewFields.ViewFields = this.GetViewFields(true);

            AddViewQuery addViewQuery = new AddViewQuery();
            addViewQuery.Query = this.GetCamlQueryRootForWhere(false);

            AddViewRowLimit rowLimit = new AddViewRowLimit();
            rowLimit.RowLimit = this.GetAvailableRowLimitDefinition();

            string type = this.GenerateRandomString(5);
            type = "a" + type;

            bool caughtSoapException = false;

            // Call AddView method to add a list view with invalid type.
            try
            {
                 Adapter.AddView(listName, displayName, viewFields, addViewQuery, rowLimit, type, false);
            }
            catch (SoapException soapException)
            {
                caughtSoapException = true; 

                // If server returns an exception when the type element is not empty and is not one of the values Calendar, Grid or Html, then the following requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    soapException,
                    101,
                    @"[In type] When the value of the element [the type element] is not empty and is not one of the values listed in the table [Calendar, Grid, Html], the protocol server MUST throw a SOAP fault message.");
            }

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