Esempio n. 1
0
        public void GetDistributionList_EmptyObjectIdAndAlias_Failure()
        {
            DistributionList oList;
            var res = DistributionList.GetDistributionList(out oList, _mockServer);

            Assert.IsFalse(res.Success, "GetDistributionList failed to catch empty alias and ObjectId being passed");
        }
Esempio n. 2
0
        public void GetDistributionList_BlankAliasAndName_Failure()
        {
            DistributionList oList;
            var res = DistributionList.GetDistributionList(out oList, _mockServer);

            Assert.IsFalse(res.Success, "Blank alias/objectID params on GetDistributionList did not fail");
        }
Esempio n. 3
0
        public void GetDistributionListVoiceName_Test()
        {
            //use the same string for the alias and display name here
            String strWavName = "TempWAV_" + Guid.NewGuid().ToString();

            //create new list with GUID in the name to ensure uniqueness
            DistributionList oList;

            WebCallResult res = DistributionList.GetDistributionList(out oList, _connectionServer, "", "allvoicemailusers");

            Assert.IsTrue(res.Success, "Fetch of AllVoiceMailUsers list failed:" + res.ToString());
            Assert.AreNotEqual(oList, null, "Fetch of AllVoiceMailUsers list failed returning an empty list");

            //first, get from static method without voice name
            res = DistributionList.GetDistributionListVoiceName(_connectionServer, strWavName, oList.ObjectId);
            Assert.IsTrue(res.Success, "Static method fetch of voice name for allVoiceMailUsers failed:" + res.ToString());
            Assert.IsTrue(File.Exists(strWavName), "Static method voice name fetch did not produce a wav file as expected.");

            File.Delete(strWavName);

            //generate new wav name just to be save
            strWavName = "TempWAV_" + Guid.NewGuid().ToString();

            //now fetch from list instance
            res = oList.GetVoiceName(strWavName);

            Assert.IsTrue(res.Success, "Instance method voice name fetch failed:" + res.ToString());
            Assert.IsTrue(File.Exists(strWavName), "Instance method voice name fetch did not produce a wav file as expected.");

            //clean up the temporary WAV file name
            File.Delete(strWavName);
        }
Esempio n. 4
0
        public void GetDistributionList_NullConnectionServer_Failure()
        {
            DistributionList oList;

            WebCallResult res = DistributionList.GetDistributionList(out oList, null, "", "allvoicemailusers");

            Assert.IsFalse(res.Success, "Null Connection server on GetDistributionList did not fail.");
        }
Esempio n. 5
0
        public void StaticCallFailures_GetDistributionList()
        {
            DistributionList oList;

            var res = DistributionList.GetDistributionList(out oList, _connectionServer, "", "bogus alias");

            Assert.IsFalse(res.Success, "GetDistributionList failed to catch bogus alias and empty ObjectId being passed");

            res = DistributionList.GetDistributionList(out oList, _connectionServer, "bogus", "");
            Assert.IsFalse(res.Success, "GetDistributionList failed to catch bogus objectId being passed");
        }
Esempio n. 6
0
        public void DistributionList_FetchTests()
        {
            List <DistributionList> oLists;
            var res = DistributionList.GetDistributionLists(_connectionServer, out oLists, 1, 2, null);

            Assert.IsTrue(res.Success, "Failed fetching lists:" + res);
            Assert.IsTrue(oLists.Count > 0, "No public lists fetched");

            //now do a full fetch
            DistributionList oFullList;

            res = DistributionList.GetDistributionList(out oFullList, _connectionServer, oLists[0].ObjectId);
            Assert.IsTrue(res.Success, "Failed fetching single list:" + res);
            Assert.IsNotNull(oFullList, "Null full list returned from fetch");
            Assert.IsTrue(oFullList.ObjectId.Equals(oLists[0].ObjectId), "ObjectId used for fetching list does not matched the returned list");

            Console.WriteLine(oFullList.DumpAllProps());
            Console.WriteLine(oFullList.ToString());
        }
Esempio n. 7
0
        public void DistributionList_MembershipEdit()
        {
            //Add a user to it.
            UserBase      oUser;
            WebCallResult res = UserBase.GetUser(out oUser, _connectionServer, "", "operator");

            Assert.IsTrue(res.Success, "Getting operator for new distribution list failed: " + res.ToString());

            res = _tempList.AddMemberUser(oUser.ObjectId);
            Assert.IsTrue(res.Success, "Adding operator user to new distribution list failed: " + res.ToString());

            //Add a list to it
            DistributionList oNewList;

            res = DistributionList.GetDistributionList(out oNewList, _connectionServer, "", "allvoicemailusers");
            Assert.IsTrue(res.Success, "Get AllVoiceMail users list failed: " + res.ToString());

            res = _tempList.AddMemberList(oNewList.ObjectId);
            Assert.IsTrue(res.Success, "Adding AllUsersDistribution list as a member to the new list failed: " + res.ToString());

            //get count - make sure it equals 2
            List <DistributionListMember> oMemberList;

            res = _tempList.GetMembersList(out oMemberList);
            Assert.IsTrue(res.Success, "Getting membership list from new distribution list failed: " + res.ToString());
            Assert.AreEqual(oMemberList.Count, 2, "Membership list fetch from new distribution list did not return 2 members as it should.");

            //remove both members from it - also exercise the DistributionListMember toString and DumpAll here
            foreach (DistributionListMember oMember in oMemberList)
            {
                Console.WriteLine(oMember.ToString());
                Console.WriteLine(oMember.DumpAllProps());
                res = _tempList.RemoveMember(oMember.ObjectId);

                Assert.IsTrue(res.Success, "Removal of member from new distribution list failed for:" + oMember);
            }

            //get count - make sure it equals 0
            res = _tempList.GetMembersList(out oMemberList);
            Assert.IsTrue(res.Success, "Failed getting members list:" + res);
            Assert.AreEqual(oMemberList.Count, 0, "After removal of members from the new distribution list the count of members reports more than 0.");
        }