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); }
public void EditStatusTest() { TicketStatus temp = NewStatus(); InsertStatusIntoDatabase(temp); //Make sure the insertion worked smoothly. Assert.IsTrue(temp.Equals(SelectStatusId(temp.TicketStatusId)), "The created status and selected status do not match. Insertion or selection might have failed"); //Change the values... temp.Name = "New Module name!"; temp.Description = "New Module Description"; temp.IsActive = false; temp.StatusOrder = 3; //Peform the update. HelpdeskService.EditStatus(temp); //Create a new instance of the module object and compare them... TicketStatus temp2 = SelectStatusId(temp.TicketStatusId); //Make sure they match. Assert.IsTrue(temp.Equals(temp2), "The updated status did not match equality with the prepared module values in the method."); }