public void GetAssignmentsByUserTest() { AssignmentCollection tempAssignmentCol = new AssignmentCollection(); //Create a new assignment, insert it into the database, and then insert it into the Assignment Collection. for (int x = 0; x < 10; x++) { Assignment temp = NewAssignment(); temp.AssignedTo = "testing"; InsertAssignmentIntoDatabase(temp); tempAssignmentCol.Add(temp); } //Get all Assignments by that Ticket Id... AssignmentCollection tempAssignmentCol2 = HelpdeskService.GetAssignmentsByUser("testing"); foreach (Assignment temp in tempAssignmentCol) { Assert.IsTrue(tempAssignmentCol2.Contains(temp), "The new assignment collection did not contain the same data as the original"); } Assert.IsTrue(tempAssignmentCol2.Count >= tempAssignmentCol.Count); }
public void GetAssignmentsByTicketIdTest() { AssignmentCollection tempAssignmentCol = new AssignmentCollection(); //Create a new assignment, insert it into the database, and then insert it into the Assignment Collection. for (int x = 0; x < 10; x++) { Assignment temp = NewAssignment(); temp.TicketId = 0; InsertAssignmentIntoDatabase(temp); tempAssignmentCol.Add(temp); } //Get all Assignments by that Ticket Id... AssignmentCollection tempAssignmentCol2 = HelpdeskService.GetAssignmentsByTicketId(0); foreach (Assignment temp in tempAssignmentCol) { Assert.IsTrue(tempAssignmentCol2.Contains(temp)); } Assert.IsTrue(tempAssignmentCol2.Count == tempAssignmentCol.Count); }