コード例 #1
0
        public void AddList_WhenValidValues_ShouldReturnList(int[] arrayList, int[] arrayAddedList, int[] expectedArray)
        {
            Lists actual             = new Lists(arrayList);
            Lists arrayListForAdding = new Lists(arrayAddedList);
            Lists expected           = new Lists(expectedArray);

            actual.AddList(arrayListForAdding);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
ファイル: SharePointSite.cs プロジェクト: bsimser/spwrappers
        /// <summary>
        /// Creates a new list in the current site.
        /// </summary>
        /// <param name="listName">Name of the list</param>
        /// <param name="listDescription">Description for the list</param>
        /// <param name="templateId">Template ID to use when creating the list. 100 is for custom
        /// list. For other types please refer to the SharePoint SDK</param>
        /// <returns>A new <see cref="SharePointList"/> object.</returns>
        public SharePointList CreateList(string listName, string listDescription, int templateId)
        {
            Lists lws = NewListsWebService();

            lws.AddList(listName, listDescription, templateId);
            XmlNode nodeList = lws.GetList(listName);
            Guid    listGuid = new Guid(nodeList.Attributes["ID"].Value.ToString());

            string version           = nodeList.Attributes["Version"].Value.ToString();
            string convertedListName = listName.Replace(" ", "%20");
            string listPath          = siteUrl + "/Lists/" + convertedListName;

            SharePointList list = new SharePointList(siteUrl, listName, listPath, listGuid);

            list.Version = version;
            return(list);
        }