private void t08_ListItemCount1(SPOClient spoc, bool isLibrary, string listname)
        {
            try { spoc.DeleteList(listname); } catch { };

            // Create list or library with one column
            SPOList spol = createListOrLibrary(spoc, isLibrary, listname,
                                               new List <SPOClient.FieldSpec>()
            {
                new SPOClient.FieldSpec()
                {
                    Name = "mySingleTextLine", Type = "Text"
                }
            });

            string foldername = "a/b/";

            var td = new[]
            {
                new { withFolder = true, root = 1, folder = 1 },
                new { withFolder = false, root = 2, folder = 1 },
                new { withFolder = false, root = 3, folder = 1 },
                new { withFolder = true, root = 3, folder = 2 },
            };

            verifyFolderContent(spoc, spol, "", 0);
            verifyFolderContent(spoc, spol, foldername, -1);

            for (int i = 0; i != td.Length; i++)
            {
                addDocument(spoc, spol, (td[i].withFolder ? foldername : string.Empty) + "Document_" + i + ".pdf");
                verifyFolderContent(spoc, spol, "", td[i].root);
                verifyFolderContent(spoc, spol, foldername, td[i].folder);
            }
            deleteListOrLibrary(spoc, listname);
        }
        private void reallyRemoveTestLists(SPOTestSystem ts, string listname)
        {
            // http://stackoverflow.com/questions/42146301/deleting-list-does-not-work-list-does-not-exist

            SPOClient spoc = createClient(ts) as SPOClient;

            spoc.Login();

            try { spoc.DeleteList(listname); } catch (Exception e) { var x = e.Message; }
            spoc.CreateList(listname, false);

            spoc = createClient(ts) as SPOClient;
            spoc.Login();

            spoc.DeleteList(listname);
            spoc.Dispose();
        }
 private SPOList createListOrLibrary(
     SPOClient spoc,
     bool isLibrary,
     string name, List <SPOClient.FieldSpec> fieldSpecs = null)
 {
     try { spoc.DeleteList(name); } catch (Exception e) { var x = e.Message; }
     return(spoc.CreateList(name, isLibrary, fieldSpecs));
 }
        private void t08_ListCreation1(SPOTestSystem ts)
        {
            SPOClient spoc = createClient(ts) as SPOClient;

            spoc.Login();

            string listname = unitTestList;

            //string listname = "abc";

            try { spoc.DeleteList(listname); } catch (Exception e) { var x = e.Message; }
            spoc.CreateList(listname, false);

            spoc = createClient(ts) as SPOClient;
            spoc.Login();

            spoc.DeleteList(listname);
        }
 private void deleteListOrLibrary(SPOClient spoc, string name)
 {
     try { spoc.DeleteList(name); } catch { }
 }