Ejemplo n.º 1
0
        private void t05_AddDocument1(SPOTestSystem ts, bool isLibrary, string listName)
        {
            SPOClient spoc = createClient(ts) as SPOClient;

            spoc.Login();

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

            // Test without and with subfodlers.
            // Always twice to handle the case where stuff already exists.
            addDocument(spoc, spol, "/MyFirstDocument.pdf");
            addDocument(spoc, spol, "MyFirstDocument.pdf");
            addDocument(spoc, spol, "sub/subsub/MyFirstDocument.pdf");
            addDocument(spoc, spol, "/sub/subsub/MySecondDocument.pdf");

            deleteListOrLibrary(spoc, listName);
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        /// This is not really a unit test but some place to play around.
        public void t00_TestAndExplore()
        {
            CultureInfo ci = new CultureInfo("en-US", false);
            DateTime    dt;

            dt = DateTime.Parse("february/15/2017", ci);
            dt = DateTime.Parse("02/15/2017", ci);

            SPOClient spoc = createClient(testsystems.Where(n => n.TestSystemName == "vmsp2013").First()) as SPOClient;

            spoc.Login();
        }
Ejemplo n.º 5
0
 public void t08_ListItemCount()
 {
     foreach (SPOTestSystem ts in testsystems)
     {
         if (ts.Active)
         {
             SPOClient spoc = createClient(ts) as SPOClient;
             spoc.Login();
             t08_ListItemCount1(spoc, false, unitTestList);
             t08_ListItemCount1(spoc, true, unitTestLibrary);
         }
     }
 }
Ejemplo n.º 6
0
        private void t06_ColumnTypes1(SPOTestSystem ts)
        {
            SPOClient spoc = createClient(ts) as SPOClient;

            spoc.Login();

            SPOList spol = createListOrLibrary(spoc, false, unitTestList);

            var td = new[]
            {
                new { n = 00, type = "Text", value = "HelloWorld", culture = "en-US" },
                new { n = 10, type = "DateTime", value = "02/15/2017", culture = "en-US" },
                new { n = 11, type = "DateTime", value = "15.02.2017", culture = "de-DE" },
                new { n = 12, type = "DateTime", value = "", culture = "de-DE" },
                new { n = 20, type = "Note", value = "Line1\nLine2", culture = "en-US" },
                new { n = 30, type = "Choice", value = "Berlin", culture = "en-US" },
                new { n = 40, type = "Number", value = "12.34", culture = "en-US" },
                new { n = 41, type = "Number", value = "12,34", culture = "de-DE" },
                new { n = 42, type = "Number", value = "", culture = "de-DE" },
                new { n = 50, type = "Currency", value = "14.22", culture = "en-US" },
                new { n = 51, type = "Currency", value = "", culture = "en-US" },
                new { n = 60, type = "Boolean", value = "False", culture = "en-US" },
                //new { n = 7, type = "Lookup", value = "abc", },
                //new { n = 8, type = "User", value = @"0#.w|vmsp2013\administrator", },
            };
            int doOnly = -1;

            for (int i = 0; i != td.Length; i++)
            {
                if (doOnly > 0 && td[i].n != doOnly)
                {
                    continue;
                }

                string name = "a" + td[i].type;
                string type = td[i].type;
                spoc.AddFieldToList(spol, new SPOClient.FieldSpec()
                {
                    Name = name, Type = type
                });
                spoc.ClientCulture = new CultureInfo(td[i].culture, false);
                testOneType(spoc, spol, type, name, td[i].value);
                spoc.DeleteField(spol, name);
            }
            Assert.IsTrue(doOnly < 0, "Not all tests executed");

            deleteListOrLibrary(spoc, unitTestList);
        }