public void SortOnMiddleRequestedOrder()
        {
            //Add a few status's to the database...
            TicketStatusCollection tempCol = new TicketStatusCollection();
            for (int x = 0; x < 10; x++)
            {
                TicketStatus tempStatus = NewStatus();
                InsertStatusIntoDatabase(tempStatus);
                tempCol.Add(tempStatus);
            }

            //Set up our test status.
            TicketStatus temp = NewStatus();
            temp.StatusOrder = 1;
            HelpdeskService.CreateStatus(temp);

            //Fetch all of the status'
            TicketStatusCollection tempCol2 = HelpdeskService.GetAllStatus();

            int MiddleStatusOrder = tempCol2.Count / 2;

            temp.StatusOrder = MiddleStatusOrder;

            HelpdeskService.EditStatus(temp);

            Assert.IsTrue(MiddleStatusOrder == temp.StatusOrder);
        }
Beispiel #2
0
        public void GetAllTicketStatuses()
        {
            TicketStatusCollection ticketStatuses = TestSetup.KayakoApiService.Tickets.GetTicketStatuses();

            Assert.IsNotNull(ticketStatuses, "No ticket statuses were returned");
            Assert.IsNotEmpty(ticketStatuses, "No ticket statuses were returned");
        }
        public void SortOnMiddleRequestedOrder()
        {
            //Add a few status's to the database...
            TicketStatusCollection tempCol = new TicketStatusCollection();

            for (int x = 0; x < 10; x++)
            {
                TicketStatus tempStatus = NewStatus();
                InsertStatusIntoDatabase(tempStatus);
                tempCol.Add(tempStatus);
            }

            //Set up our test status.
            TicketStatus temp = NewStatus();

            temp.StatusOrder = 1;
            HelpdeskService.CreateStatus(temp);

            //Fetch all of the status'
            TicketStatusCollection tempCol2 = HelpdeskService.GetAllStatus();

            int MiddleStatusOrder = tempCol2.Count / 2;

            temp.StatusOrder = MiddleStatusOrder;

            HelpdeskService.EditStatus(temp);

            Assert.IsTrue(MiddleStatusOrder == temp.StatusOrder);
        }
        /// <summary>
        /// Retrieve the ticket status identified by <paramref name="statusId"/>.
        /// </summary>
        /// <remarks>
        /// See - http://wiki.kayako.com/display/DEV/REST+-+TicketStatus#REST-TicketStatus-GET%2FTickets%2FTicketStatus%2F%24id%24
        /// </remarks>
        /// <param name="statusId">The unique numeric identifier of the ticket status.</param>
        /// <returns>The ticket status</returns>
        public TicketStatus GetTicketStatus(int statusId)
        {
            string apiMethod = String.Format("/Tickets/TicketStatus/{0}", statusId);

            TicketStatusCollection statuses = Connector.ExecuteGet <TicketStatusCollection>(apiMethod);

            if (statuses != null && statuses.Count > 0)
            {
                return(statuses[0]);
            }
            return(null);
        }
Beispiel #5
0
        public void GetTicketType()
        {
            TicketStatusCollection ticketStatuses = TestSetup.KayakoApiService.Tickets.GetTicketStatuses();

            Assert.IsNotNull(ticketStatuses, "No ticket statuses were returned");
            Assert.IsNotEmpty(ticketStatuses, "No ticket statuses were returned");

            TicketStatus randomTicketStatusToGet = ticketStatuses[new Random().Next(ticketStatuses.Count)];

            Trace.WriteLine("GetTicketType using ticket status id: " + randomTicketStatusToGet.Id);

            TicketStatus ticketType = TestSetup.KayakoApiService.Tickets.GetTicketStatus(randomTicketStatusToGet.Id);

            CompareTicketTypes(ticketType, randomTicketStatusToGet);
        }
        public void SortOnTooLargeRequestedOrder()
        {
            TicketStatusCollection tempCol = HelpdeskService.GetAllStatus();

            int TooLargeStatusOrder = tempCol.Count + 15;
            int ExpectedStatusOrder = tempCol.Count + 1;

            TicketStatus temp = NewStatus();

            temp.StatusOrder = TooLargeStatusOrder;

            HelpdeskService.CreateStatus(temp);

            Trace.WriteLine(temp.StatusOrder);
            Assert.IsTrue(ExpectedStatusOrder == temp.StatusOrder);
        }
        public void GetAllStatusTest()
        {
            TicketStatusCollection tempCol = new TicketStatusCollection();

            //Create a new module, insert it into the database, and then insert it into the Module Collection.
            for (int x = 0; x < 10; x++)
            {
                TicketStatus tempStatus = NewStatus();
                InsertStatusIntoDatabase(tempStatus);
                tempCol.Add(tempStatus);
            }

            //Get all Modules...
            TicketStatusCollection tempCol2 = HelpdeskService.GetAllStatus();
            foreach (TicketStatus temp in tempCol)
            {
                Assert.IsTrue(tempCol2.Contains(temp), "The inserted collection and the retrived collection did not match in number or type.");
            }
        }
        public void GetAllStatusTest()
        {
            TicketStatusCollection tempCol = new TicketStatusCollection();

            //Create a new module, insert it into the database, and then insert it into the Module Collection.
            for (int x = 0; x < 10; x++)
            {
                TicketStatus tempStatus = NewStatus();
                InsertStatusIntoDatabase(tempStatus);
                tempCol.Add(tempStatus);
            }

            //Get all Modules...
            TicketStatusCollection tempCol2 = HelpdeskService.GetAllStatus();

            foreach (TicketStatus temp in tempCol)
            {
                Assert.IsTrue(tempCol2.Contains(temp), "The inserted collection and the retrived collection did not match in number or type.");
            }
        }