Пример #1
0
        public void GetInterviewHandler_EmptyObjectIdAndDisplayName_Failure()
        {
            InterviewHandler oInterviewer;
            var res = InterviewHandler.GetInterviewHandler(out oInterviewer, _mockServer);

            Assert.IsFalse(res.Success, "Calling static method GetInterviewHandler did not fail with: empty objectID and display name");
        }
        public void GetInterviewHandler_InvalidObjectId_Failure()
        {
            InterviewHandler oInterviewer;

            var res = InterviewHandler.GetInterviewHandler(out oInterviewer, _connectionServer, "objectId", "DisplayName");

            Assert.IsFalse(res.Success, "Calling static method GetInterviewHandler did not fail with: invalid objectId and display name");
        }
Пример #3
0
        public void GetInterviewHandler_BlankObjectIdAndName_Failure()
        {
            InterviewHandler oHandler;

            var res = InterviewHandler.GetInterviewHandler(out oHandler, _mockServer);

            Assert.IsFalse(res.Success, "GetInterviewHandler should fail if the ObjectId and display name are both blank");
        }
Пример #4
0
        public void GetInterviewHandler_NullConnectionServer_Failure()
        {
            InterviewHandler oInterviewer;

            var res = InterviewHandler.GetInterviewHandler(out oInterviewer, null, "objectId", "DisplayName");

            Assert.IsFalse(res.Success, "Calling static method GetInterviewHandler did not fail with: null ConnectionServer");
        }
        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");
        }
        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);
        }