コード例 #1
0
        public void UserFull_GetUser_InvalidObjectId_Failure()
        {
            UserFull oUserFull;
            var      res = UserFull.GetUser(_connectionServer, "ObjectId", out oUserFull);

            Assert.IsFalse(res.Success, "Invalid Usser ObjectId should fail");
        }
コード例 #2
0
ファイル: FormUserFunctions.cs プロジェクト: ItsMoShehab/CUC
        /// <summary>
        /// Show the exit destination of the user in a human readable description.
        /// </summary>
        private void buttonShowExitDestination_Click(object sender, EventArgs e)
        {
            WebCallResult res;

            if (gridUsers.SelectedRows.Count < 1)
            {
                MessageBox.Show("You must first select a user to show the exit details for.");
                return;
            }

            //the objectID and alias values will always be in the result set.
            string strObjectID = gridUsers.SelectedRows[0].Cells["ObjectId"].Value.ToString();

            UserFull oUser;

            res = UserFull.GetUser(GlobalItems.CurrentConnectionServer, strObjectID, out oUser);

            if (res.Success == false)
            {
                MessageBox.Show("Failed fetching user:"******"Exit action={0}",
                                               GlobalItems.CurrentConnectionServer.GetActionDescription(
                                                   oUser.ExitAction, oUser.ExitTargetConversation,
                                                   oUser.ExitTargetHandlerObjectId));

            MessageBox.Show(strExitInfo);
        }
コード例 #3
0
ファイル: UserUnitTests.cs プロジェクト: ItsMoShehab/CUC
        public void UserFull_GetUser_EmptyObjectId_Failure()
        {
            UserFull oUserFull;
            var      res = UserFull.GetUser(_mockServer, "", out oUserFull);

            Assert.IsFalse(res.Success, "Empty User ObjectId should fail");
        }
コード例 #4
0
ファイル: UserUnitTests.cs プロジェクト: ItsMoShehab/CUC
        public void UserFull_GetUser_NullConnectionServer_Failure()
        {
            UserFull oUserFull;
            var      res = UserFull.GetUser(null, "ObjectId", out oUserFull);

            Assert.IsFalse(res.Success, "Null Connection server object should fail");
        }
コード例 #5
0
        /// <summary>
        /// Import an LDAP user as a local Unity Connection user.
        /// </summary>
        /// <param name="pConnectionServer">
        /// Connection server to import the user on.
        /// </param>
        /// <param name="pTemplateAlias">
        /// Alias of the user template to use when importing the user, required.
        /// </param>
        /// <param name="pPkid">
        /// Unique ID from the Call Manager database for the LDAP synchronized user.
        /// </param>
        /// <param name="pAlias">
        /// Alias of the user in LDAP to import
        /// </param>
        /// <param name="pFirstName">
        /// First name of the user to import
        /// </param>
        /// <param name="pLastName">
        /// Last name of the user to import
        /// </param>
        /// <param name="pExtension">
        /// Extension number to assign the user in Connection's diretory
        /// </param>
        /// <param name="pPropList">
        /// Name value pair list of optional values to include in the import.
        /// </param>
        /// <param name="pUser">
        /// Instance of the UserFull class is passed back filled in with the details of the newly import user if the
        /// import succeeds.  Null if the import fails.
        /// </param>
        /// <returns>
        /// Instance of the WebCallResults class with details of the call and results from the server.
        /// </returns>
        public static WebCallResult ImportLdapUser(ConnectionServerRest pConnectionServer, string pTemplateAlias,
                                                   string pPkid, string pAlias, string pFirstName, string pLastName,
                                                   string pExtension, ConnectionPropertyList pPropList, out UserFull pUser)
        {
            pUser = null;

            var res = ImportLdapUser(pConnectionServer, pTemplateAlias, pPkid, pAlias, pFirstName, pLastName,
                                     pExtension, pPropList);

            if (res.Success)
            {
                return(UserFull.GetUser(pConnectionServer, res.ReturnedObjectId, out pUser));
            }
            return(res);
        }
コード例 #6
0
ファイル: UserUnitTests.cs プロジェクト: ItsMoShehab/CUC
        public void UserFull_GetUser_ErrorResponse_Failure()
        {
            //error response
            _mockTransport.Setup(
                x => x.GetCupiResponse(It.IsAny <string>(), It.IsAny <MethodType>(), It.IsAny <ConnectionServerRest>(),
                                       It.IsAny <string>(), true)).Returns(new WebCallResult
            {
                Success      = false,
                ResponseText = "error text",
                StatusCode   = 404
            });

            UserFull oUser;
            var      res = UserFull.GetUser(_mockServer, "objectid", out oUser);

            Assert.IsFalse(res.Success, "Calling GetUser with error respone should fail");
        }
コード例 #7
0
        public void UserFull_GetUser_ByObjectId_Success()
        {
            UserFull oUserFull;
            var      res = UserFull.GetUser(_connectionServer, _tempUser.ObjectId, out oUserFull);

            Assert.IsTrue(res.Success, "Failed to fetch full user properties for selected user by objectId");

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

            //dump primary call handler details
            Console.WriteLine(oUserFull.PrimaryCallHandler().ToString());

            Console.WriteLine(oUserFull.PrimaryCallHandler(true).ToString());

            // dump the phone system details
            Console.WriteLine(oUserFull.PhoneSystem().ToString());
            Console.WriteLine(oUserFull.PhoneSystem(true).ToString());

            //dump the private list details
            Console.WriteLine(oUserFull.PrivateLists().ToString());
            Console.WriteLine(oUserFull.PrivateLists(true).ToString());

            //dump the MWI list
            Console.WriteLine(oUserFull.Mwis().ToString());
            Console.WriteLine(oUserFull.Mwis(true).ToString());

            //dump the COS details
            Console.WriteLine(oUserFull.Cos().ToString());
            Console.WriteLine(oUserFull.Cos(true).ToString());

            //Show the user's credentials for PIN and Password
            Console.WriteLine("User PIN credential details:" + oUserFull.Pin());
            Console.WriteLine(oUserFull.Pin().DumpAllProps());

            Console.WriteLine("User Password credential details:" + oUserFull.Password());
            Console.WriteLine(oUserFull.Password().DumpAllProps());
        }