Microsoft.Protocols.TestSuites.MS_LISTSWS.S03_OperationOnListItem.MSLISTSWS_S03_TC46_GetListItems_NonExistentViewName C# (CSharp) Method

MSLISTSWS_S03_TC46_GetListItems_NonExistentViewName() private method

        public void MSLISTSWS_S03_TC46_GetListItems_NonExistentViewName()
        {
            #region Invoke AddList operation to create a new generic list.
            string strList_GUID = TestSuiteHelper.CreateList((int)TemplateType.Generic_List);
            #endregion

            #region Invoke GetListItems operation when the value of element "viewName" does not correspond to an exist view in the list.
            // Invoke GetListItems operation when the value of element "viewName" does not correspond to an existing view in the list.
            // If protocol SUT returns a SOAP fault, capture R730. 
            string strInvalidViewGUID = Guid.NewGuid().ToString();
            bool isSoapFaultGenerated = false;
            string expectErrorCode = "0x82000005";
            string errorCode = string.Empty;
            try
            {
                this.listswsAdapter.GetListItems(strList_GUID, strInvalidViewGUID, null, null, null, null, null);
            }
            catch (SoapException ex)
            {
                isSoapFaultGenerated = true;
                errorCode = TestSuiteHelper.GetErrorCode(ex);
            }
            #endregion

            #region Capture Requirement #730 and #1913 when protocol SUT returns SOAP fault with error code "0x82000005" in the response of "GetListItems".

            Site.CaptureRequirementIfIsTrue(
                isSoapFaultGenerated,
                730,
                @"[In GetListItems operation] If the viewName parameter does not correspond to a view that exists and "
                + "each of the optional query, viewFields, queryOptions, and rowLimit parameters are not specified, "
                + "the protocol server MUST return a SOAP fault.");

            Site.CaptureRequirementIfIsTrue(
                expectErrorCode.Equals(errorCode, StringComparison.OrdinalIgnoreCase),
                1913,
                @"[In GetListItems operation] [If the viewName parameter does not correspond to a view that exists and each of the optional query, viewFields, queryOptions, and rowLimit parameters are not specified, the protocol server MUST return a SOAP fault.] The error code is 0x82000005.");

            #endregion
        }
S03_OperationOnListItem