Microsoft.Protocols.TestSuites.MS_LISTSWS.S01_OperationOnList.MSLISTSWS_S01_TC10_DeleteList_Succeed C# (CSharp) Method

MSLISTSWS_S01_TC10_DeleteList_Succeed() private method

private MSLISTSWS_S01_TC10_DeleteList_Succeed ( ) : void
return void
        public void MSLISTSWS_S01_TC10_DeleteList_Succeed()
        {
            // Add a generic list.
            string listName = TestSuiteHelper.GetUniqueListName();
            int templateId = (int)TemplateType.Generic_List;
            AddListResponseAddListResult addResult = this.listswsAdapter.AddList(listName, string.Empty, templateId);
            bool addListSucceeded = addResult != null && addResult.List != null && !string.IsNullOrEmpty(addResult.List.ID);
            this.Site.Assert.IsTrue(addListSucceeded, "Test suite should add the list successfully.");

            // Delete the list.
            this.listswsAdapter.DeleteList(addResult.List.ID);
            XmlNode responseXmlNode = (XmlNode)SchemaValidation.LastRawResponseXml;
            string reponse = responseXmlNode.FirstChild.FirstChild.LocalName;

            // Call GetListCollection when there is not any list in the server. The output lists should not contain the added list information.
            GetListCollectionResponseGetListCollectionResult result = this.listswsAdapter.GetListCollection();
            bool isExist = result.Lists.Any(founder => founder.Title.Equals(listName, StringComparison.OrdinalIgnoreCase));

            // If the DeleteListResponse is returned ,then capture R520 and R521.
            Site.CaptureRequirementIfAreEqual<string>(
                "DeleteListResponse",
                reponse,
                520,
                @"[In DeleteList operation] If the specified listName is a valid GUID and corresponds to the identification of a list on the site, that list MUST be deleted and the protocol server MUST return a DeleteListResponse element.");

            Site.CaptureRequirementIfAreEqual<string>(
                "DeleteListResponse",
                reponse,
                521,
                @"[In DeleteList operation] If the specified listName is not a valid GUID, check if the listName corresponds to the list title of a list on the site and if so, that list MUST be deleted and the protocol server MUST return a DeleteListResponse element.");

            // If the new added list exists in the server, then capture R524.
            Site.CaptureRequirementIfIsFalse(
                isExist,
                524,
                @"[In DeleteList operation] If there are no other errors, the list MUST be deleted.");
        }
S01_OperationOnList