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

MSLISTSWS_S03_TC10_GetListItemChangesSinceToken_NotMatchChangeToken() private method

        public void MSLISTSWS_S03_TC10_GetListItemChangesSinceToken_NotMatchChangeToken()
        {
            // Use random generate string as an invalid token.
            string invalidToken = TestSuiteHelper.GenerateRandomString(10);

            // Create a list and add two items.
            string listId = TestSuiteHelper.CreateList();
            TestSuiteHelper.AddListItems(listId, 2);

            // Call GetListItemChangesSinceToken with invalid change token.
            bool isSoapFault = false;
            string errorCode = null;
            try
            {
                this.listswsAdapter.GetListItemChangesSinceToken(
                                                                 listId,
                                                                 null,
                                                                 null,
                                                                 null,
                                                                 null,
                                                                 null,
                                                                 invalidToken,
                                                                 null);
            }
            catch (SoapException exp)
            {
                errorCode = TestSuiteHelper.GetErrorCode(exp);
                isSoapFault = true;
            }

            Site.Assert.IsTrue(
                    isSoapFault,
                    "When the list name is a GUID and the change token is invalid token value, call the operation GetListItemChangesSinceToken will return a soap fault");

            // If SOAP fault returned, capture R664.
            Site.CaptureRequirementIfIsTrue(
                    isSoapFault,
                    664,
                    @"[In GetListItemChangesSinceToken operation] If the value of the changeToken parameter does not match 
                    a change token known to the protocol server, the protocol server MUST return a SOAP fault.");

            // If there is no error code returned in the soap fault, capture R1878.
            Site.CaptureRequirementIfAreEqual<string>(
                    null,
                    errorCode,
                    1878,
                    @"[In GetListItemChangesSinceToken operation] [If the value of the changeToken parameter does not "
                    + "match a change token known to the protocol server, the protocol server MUST return a SOAP fault.]"
                    + "There is no error code for this fault.");
        }
S03_OperationOnListItem