Exemple #1
0
        public void GetInterviewHandlers_NullConnectionServer_Failure()
        {
            List <InterviewHandler> oHandlers;
            WebCallResult           res = InterviewHandler.GetInterviewHandlers(null, out oHandlers);

            Assert.IsFalse(res.Success,
                           "Calling static method GetInterviewHandlers did not fail with: null ConnectionServer");
        }
Exemple #2
0
        public void Interviewer_Test()
        {
            _errorString = "";
            List <InterviewHandler> oInterviewHandlers;
            var res = InterviewHandler.GetInterviewHandlers(_connectionServer, out oInterviewHandlers, 1, 2);

            Assert.IsTrue(res.Success & oInterviewHandlers.Count > 0, "Failed to fetch interview handlers:" + res);
            Assert.IsTrue(string.IsNullOrEmpty(_errorString), "Error parsing Json for interview handlers:" + _errorString);

            List <InterviewQuestion> oQuestions;

            res = InterviewQuestion.GetInterviewQuestions(_connectionServer, oInterviewHandlers[0].ObjectId, out oQuestions);
            Assert.IsFalse(res.Success == false || oQuestions.Count == 0, "Failed to fetch interviewer questions");
            Assert.IsTrue(string.IsNullOrEmpty(_errorString), "Error parsing Json for interview handler questions:" + _errorString);
        }
        public void GetInterviewHandler_Failure()
        {
            InterviewHandler oHandler;

            WebCallResult res = InterviewHandler.GetInterviewHandler(out oHandler, null);

            Assert.IsFalse(res.Success, "GetInterviewHandler should fail if the ConnectionServerRest is null");

            res = InterviewHandler.GetInterviewHandler(out oHandler, _connectionServer);
            Assert.IsFalse(res.Success, "GetInterviewHandler should fail if the ObjectId and display name are both blank");

            List <InterviewHandler> oList;

            res = InterviewHandler.GetInterviewHandlers(_connectionServer, out oList, 1, 1);
            Assert.IsTrue(res.Success, "Failed to fetch list of interviewers:" + res);
            Assert.IsTrue(oList.Count > 0, "No interviewers returned from list fetch");
        }
Exemple #4
0
        public void GetActionDescripiton_InterviewHandlers()
        {
            List <InterviewHandler> oInterviewHandlers;
            var res = InterviewHandler.GetInterviewHandlers(_connectionServer, out oInterviewHandlers, 1, 1);

            Assert.IsTrue(res.Success, "Failed to fetch interview handlers:" + res);
            Assert.IsTrue(oInterviewHandlers.Count > 0, "Failed to find any interview handlers");

            string strRet = _connectionServer.GetActionDescription(ActionTypes.GoTo, ConversationNames.PHInterview,
                                                                   oInterviewHandlers[0].ObjectId);

            Assert.IsTrue(strRet.ToLower().Contains("send to interview handler:"),
                          "Interview handler route description not correct:" + strRet);

            strRet = _connectionServer.GetActionDescription(ActionTypes.GoTo, ConversationNames.PHInterview, "bogus");
            Assert.IsTrue(strRet.ToLower().Contains("invalid link"),
                          "Interview handler route description not correct for missing link:" + strRet);
        }
        public void GetInterviewHandlers_Test()
        {
            List <InterviewHandler> oHandlerList;
            string strObjectId = "";

            InterviewHandler oInterviewHandler;

            WebCallResult res = InterviewHandler.GetInterviewHandlers(_connectionServer, out oHandlerList, 1, 1, null);

            Assert.IsTrue(res.Success, "Fetching of first interview handler failed: " + res.ToString());
            Assert.AreEqual(oHandlerList.Count, 1, "Fetching of the first interview handler returned a different number of handlers: " + res.ToString());

            //exercise the ToString and DumpAllProperties as part of this test as well
            foreach (InterviewHandler oHandler in oHandlerList)
            {
                Console.WriteLine(oHandler.ToString());
                Console.WriteLine(oHandler.DumpAllProps());
                strObjectId = oHandler.ObjectId; //save for test below
            }

            //fetch interviewer by ObjectId
            res = InterviewHandler.GetInterviewHandler(out oInterviewHandler, _connectionServer, strObjectId);
            Assert.IsTrue(res.Success, "Fetching of interview handler by objectId failed: " + res.ToString());

            res = oInterviewHandler.RefetchInterviewHandlerData();
            Assert.IsTrue(res.Success, "Failed refetching interviewer data:" + res);

            Console.WriteLine(oInterviewHandler.DumpAllProps());

            res = oInterviewHandler.Update();
            Assert.IsFalse(res.Success, "Updating interview handler with no pending changes did not fail");

            //failed fetch using bogus name
            res = InterviewHandler.GetInterviewHandler(out oInterviewHandler, _connectionServer, "", "blah");
            Assert.IsFalse(res.Success, "Fetching of interview handler by bogus name did not fail");

            res = InterviewHandler.GetInterviewHandlers(_connectionServer, out oHandlerList, 1, 2, "query=(ObjectId is Bogus)");
            Assert.IsTrue(res.Success, "fetching handlers with invalid query should not fail:" + res);
            Assert.IsTrue(oHandlerList.Count == 0, "Invalid query string should return an empty handler list:" + oHandlerList.Count);
        }