Esempio n. 1
0
        //////////////////////////////////////////////////////////////////////////
        //
        // Membership import/export modify tests
        //
        //////////////////////////////////////////////////////////////////////////

        public async Task ModifyTestAddMember()
        {
            Console.WriteLine("\nModify test - Add member (expect success)");

            // noDemotions option included in case this member is already present
            // with a higher role (note that the noDemotions option won't prevent
            // member from being removed entirely, just not demoted to a lower role)
            var options = new Dictionary <string, bool>()
            {
                { "noDemotions", true }
            };

            // Note that the "grouptag:sub1" below can be any sequence of
            // characters (for easy reference in the API client system) but
            // must match the tag assigned to the sub-group in the GroupVine
            // system.

            var data = new Dictionary <string, object>()
            {
                { "importMode", "modify" },
                { "options", options },

                // List of member dicts
                { "members", new object[]
                  {
                      new Dictionary <string, string>()
                      {
                          { "email", "*****@*****.**" },
                          { "first name", "CSharp" },
                          { "last name", "Test User" },
                          { "ITOD ID", "AB12345" },
                          { "role", "x" },
                          { "grouptag:sub1", "x" },
                      }
                  } }
            };

            GvApiImportResponse resp = await this.apiRequestImport("add member", data);

            Console.WriteLine(resp);
        }
Esempio n. 2
0
        public async Task ModifyTestRemoveMember()
        {
            Console.WriteLine("\nModify test - Remove member (expect success)");

            var data = new Dictionary <string, object>()
            {
                { "importMode", "modify" },

                // List of member dicts
                { "members", new object[]
                  {
                      new Dictionary <string, string>()
                      {
                          { "email", "*****@*****.**" },
                          { "role", "" },
                          { "grouptag:sub1", "" },     // not removing from sub-group!
                      }
                  } }
            };

            GvApiImportResponse resp = await this.apiRequestImport("remove member", data);

            Console.WriteLine(resp);
        }