public void PrivateListTopLevelUpdate()
        {
            PrivateList oTestList;

            try
            {
                oTestList = new PrivateList(_connectionServer, _tempUser.ObjectId, "", 1);
                Console.WriteLine(oTestList);
            }
            catch (Exception ex)
            {
                Assert.Fail("Failed to create new private list class instance with list Id of 1" + ex);
            }

            try
            {
                oTestList = new PrivateList(_connectionServer, _tempUser.ObjectId, _tempPrivateList.ObjectId);
                Console.WriteLine(oTestList);
            }
            catch (Exception ex)
            {
                Assert.Fail("Failed to create new private list class instance with valid ObjectId" + ex);
            }

            WebCallResult res = _tempPrivateList.Update();

            Assert.IsFalse(res.Success, "Calling Update with no pending changes did not result in an error");

            Console.WriteLine(_tempPrivateList.ToString());
            Console.WriteLine(_tempPrivateList.DumpAllProps());

            res = _tempPrivateList.AddMemberUser(_tempUser.ObjectId);
            Assert.IsTrue(res.Success, "Failed to add user to private list:" + res);

            List <DistributionList> oPublicLists;

            res = DistributionList.GetDistributionLists(_connectionServer, out oPublicLists, 1, 20);
            Assert.IsTrue(res.Success, "Failed to fetch public lists:" + res);
            Assert.IsTrue(oPublicLists.Count > 0, "No public lists found");

            res = _tempPrivateList.AddMemberPublicList(oPublicLists[0].ObjectId);
            Assert.IsTrue(res.Success, "Failed to add public list as private list member:" + res);

            List <PrivateListMember> oMembers;

            res = _tempPrivateList.GetMembersList(out oMembers);
            Assert.IsTrue(res.Success, "Failed to fetch members of private list:" + res);
            Assert.IsTrue(oMembers.Count == 2, "Two members not returned from new private list");

            res = _tempPrivateList.RemoveMember(oMembers[0].ObjectId);
            Assert.IsTrue(res.Success, "Failed removing private list member:" + res);

            _tempPrivateList.DisplayName = "New display name";
            res = _tempPrivateList.Update();
            Assert.IsTrue(res.Success, "Failed updating private list:" + res);

            res = _tempPrivateList.RefetchPrivateListData();
            Assert.IsTrue(res.Success, "Failed to refetch private list data:" + res);
        }
Exemplo n.º 2
0
        public void AddMemberPublicList_OwnerObjectId_Failure()
        {
            var res = PrivateList.AddMemberPublicList(_mockServer, "PrivateListObjectId", "PublicObjectId", "");

            Assert.IsFalse(res.Success, "Adding private list public DL member via static method did not fail with empty owner objectId");
        }
        public void AddMemberPublicList_InvalidObjectIds_Failure()
        {
            var res = PrivateList.AddMemberPublicList(_connectionServer, "PrivateListObjectId", "PublicObjectId", "OwnerObjectId");

            Assert.IsFalse(res.Success, "Adding private list public DL member via static method did not fail with invalid objectId");
        }
Exemplo n.º 4
0
        public void AddMemberPublicList_NullConnectionServer_Failure()
        {
            var res = PrivateList.AddMemberPublicList(null, "ObjectId", "PublicObjectId", "OwnerObjectId");

            Assert.IsFalse(res.Success, "Adding private list public DL member via static method did not fail with null ConnectionServerRest ");
        }