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

MSLISTSWS_S03_TC78_UpdateListItemsWithKnowledge_Fail_ListNameNotExists() private method

        public void MSLISTSWS_S03_TC78_UpdateListItemsWithKnowledge_Fail_ListNameNotExists()
        {
            Site.Assume.IsTrue(Common.IsRequirementEnabled(25151, this.Site), @"Test is executed only when R25151Enabled is set to true.");

            // Construct an invalid ListId.
            string invalidListId = TestSuiteHelper.GetInvalidGuidAndNocorrespondString();

            // Read configure value.
            string validFieldName = Common.GetConfigurationPropertyValue("ListFieldText", this.Site);
            string errorCode = string.Empty;

            // Construct one insert item
            List<Dictionary<string, string>> items = new List<Dictionary<string, string>>(1);
            List<MethodCmdEnum> cmds = new List<MethodCmdEnum>(1);
            Dictionary<string, string> item1 = new Dictionary<string, string>();
            item1.Add(validFieldName, TestSuiteHelper.GenerateRandomString(5));
            items.Add(item1);
            cmds.Add(MethodCmdEnum.New);

            // Construct the UpdateListItemsUpdates instances
            UpdateListItemsWithKnowledgeUpdates updates = TestSuiteHelper.CreateUpdateListWithKnowledgeItems(cmds, items, OnErrorEnum.Continue);

            Site.Assert.IsNotNull(updates, "Created UpdateListItemsWithKnowledgeUpdates successfully");

            #region Invoke operations
            try
            {
                // Call UpdateListItemsWithKnowledge with invalid ListId.
                this.listswsAdapter.UpdateListItemsWithKnowledge(
                                                                invalidListId,
                                                                updates,
                                                                null,
                                                                null);
            }
            catch (SoapException exp)
            {
                errorCode = TestSuiteHelper.GetErrorCode(exp);
            }
            #endregion

            #region Capture Requirements R1153, R1154

            Site.CaptureRequirementIfAreEqual<string>(
                "0x82000006",
                errorCode,
                1153,
                @"[In UpdateListItemsWithKnowledge]If listName does not correspond to a list from "
                + "either of these checks, the protocol server MUST return a SOAP fault with error "
                + "code 0x82000006.");

            Site.CaptureRequirementIfAreEqual<string>(
                    "0x82000006",
                    errorCode,
                1154,
                @"[In UpdateListItemsWithKnowledge] [If listName does not correspond to a list from "
                + "either of these checks, the protocol server MUST return a SOAP fault with error "
                + "code 0x82000006.] This indicates that the list does not exist or might have been "
                + "deleted by another user.");

            #endregion
        }
S03_OperationOnListItem