Пример #1
0
        private static void AddGroupMember(SmartsheetClient smartsheet, long groupId)
        {
            GroupMember         member  = new GroupMember.AddGroupMemberBuilder("*****@*****.**").Build();
            IList <GroupMember> members = smartsheet.GroupResources.AddGroupMembers(groupId, new GroupMember[] { member });

            Assert.IsTrue(members.Count == 1);
            Assert.IsTrue(members[0].Email == "*****@*****.**");
        }
Пример #2
0
        private static long CreateGroup(SmartsheetClient smartsheet)
        {
            GroupMember member = new GroupMember.AddGroupMemberBuilder("*****@*****.**").Build();
            Group       group  = smartsheet.GroupResources.CreateGroup(
                new Group.CreateGroupBuilder("a group", "this is a group").SetMembers(new GroupMember[] { member }).Build());

            Assert.IsTrue(group.Name == "a group");
            return(group.Id.Value);
        }
        public virtual void TestCreateGroup()
        {
            server.setResponseBody("../../../TestSDK/resources/createGroup.json");

            GroupMember newMember = new GroupMember.AddGroupMemberBuilder("*****@*****.**").Build();

            GroupMember[] members  = new GroupMember[] { newMember };
            Group         newGroup = new Group.CreateGroupBuilder("API-created Group", "Group created via API").SetMembers(members).Build();

            Group createdGroup = groupResources.CreateGroup(newGroup);

            Assert.AreEqual(newGroup.Name, createdGroup.Name);
            Assert.AreEqual(newGroup.Description, createdGroup.Description);
            Assert.AreEqual(newGroup.Members[0].Email, createdGroup.Members[0].Email);
            Assert.AreEqual(4583173393803140, createdGroup.Members[0].Id);
        }