public void TBESG_AddRemove_Remove_BigList() { ToggleButtonExclusiveSelectionGroup grp = new ToggleButtonExclusiveSelectionGroup(); Gtk.ToggleButton toAdd = new Gtk.ToggleButton(); Gtk.ToggleButton toAdd2 = new Gtk.ToggleButton(); Gtk.ToggleButton toAdd3 = new Gtk.ToggleButton(); Gtk.ToggleButton toAdd4 = new Gtk.ToggleButton(); Gtk.ToggleButton toAdd5 = new Gtk.ToggleButton(); grp.Append(toAdd); grp.Append(toAdd2); grp.Append(toAdd3); grp.Append(toAdd4); grp.Append(toAdd5); Assert.AreEqual(5, grp.GetCountButton(), "There should be 5 buttons in the group"); // remove the 3rd one bool result = grp.Remove(toAdd3); Assert.AreEqual(true, result, "3rd button removal should work"); Assert.AreEqual(4, grp.GetCountButton(), "There should be 4 buttons in the group"); // make sure the 3 is no longer there int pos = grp.FindInGroup(toAdd3); Assert.AreEqual(-1, pos, "The button should not be found anymore"); }
public void TBESG_AddRemove_Remove_Invalid_High() { ToggleButtonExclusiveSelectionGroup grp = new ToggleButtonExclusiveSelectionGroup(); bool result = grp.Remove(4); Assert.AreEqual(false, result, "Invalid button to remove, shouldn't work"); Assert.AreEqual(0, grp.GetCountButton(), "There should be no button in the group"); }
public void TBESG_AddRemove_Remove_Number() { ToggleButtonExclusiveSelectionGroup grp = new ToggleButtonExclusiveSelectionGroup(); Gtk.ToggleButton toAdd = new Gtk.ToggleButton(); bool result = grp.Append(toAdd); Assert.AreEqual(true, result, "ToggleButton1 Should be able to be added"); result = grp.Remove(0); Assert.AreEqual(true, result, "ToggleButton Should be removed properly"); Assert.AreEqual(0, grp.GetCountButton(), "There should be no button in the group"); }
public void TBESG_AddRemove_Remove_NotExistant_Number() { ToggleButtonExclusiveSelectionGroup grp = new ToggleButtonExclusiveSelectionGroup(); Gtk.ToggleButton toAdd = new Gtk.ToggleButton(); bool result = grp.Append(toAdd); Assert.AreEqual(true, result, "ToggleButton1 Should be able to be added"); result = grp.Remove(4); Assert.AreEqual(false, result, "Invalid button to remove, shouldn't work"); Assert.AreEqual(1, grp.GetCountButton(), "There should be 1 button in the group"); }