public void editKidTest() { // make a kid and add him to the list kidListBox kid_list_box = new kidListBox(); kid child = new kid("Simon Owens", "Lincoln Ave"); kid_list_box.add(child); // edit him kid_list_box.edit(child, "Don Roberts", "Heaven Ave"); // only kid that should exist is the kid that we edited HashSet <kid> expectedList = new HashSet <kid>(); kid expected = new kid("Don Roberts/Heaven Ave"); expectedList.Add(expected); CollectionAssert.Equals(expectedList.ToList(), kid_list_box.getSet().ToList()); }
public void editAlreadyExisitingKidTest() { // add two kids to the list kidListBox kid_list_box = new kidListBox(); kid child1 = new kid("Simon Owens", "Lincoln Ave"); kid child2 = new kid("Don Roberts/Heaven Ave"); kid_list_box.add(child1); kid_list_box.add(child2); // edit one to what the other kid already is kid_list_box.edit(child1, "Don Roberts", "Heaven Ave"); // we already have what we edited, the edited copy should be all that is left HashSet <kid> expectedList = new HashSet <kid>(); kid expected = new kid("Don Roberts/Heaven Ave"); expectedList.Add(expected); CollectionAssert.Equals(expectedList.ToList(), kid_list_box.getSet().ToList()); }