public void ClockGroupCollectionTest_Move() { var mf = new MainForm(); var df = mf.MyDataFile; var d = new ClockVMCollection.Model(df); ClockGroupMCollection c = d.Groups; d.AppliedFilter = new FilterM(d); var cl = new TimerData(df, mf.MultiAudioPlayer) { GroupName = "g1" }; d.AddClock(cl); c.Add("g2"); c.Add("g3"); c.Move("g1", 2); Assert.AreEqual(c.GroupNames[0], "g2"); Assert.AreEqual(c.GroupNames[1], "g3"); Assert.AreEqual(c.GroupNames[2], "g1"); }
public void ClockGroupCollectionTest_Equals() { var mf = new MainForm(); var df = mf.MyDataFile; var d = new ClockVMCollection.Model(df); ClockGroupMCollection c = d.Groups; var cc = new ClockGroupMCollection(d); d.AppliedFilter = new FilterM(d); // Act c.Add("a"); c.Add("b"); c.Add("c"); cc.Add("a"); cc.Add("b"); cc.Add("c"); Assert.IsTrue(c.Equals(cc)); Bitmap bmp = SystemIcons.Asterisk.ToBitmap(); c.SetIcon("b", bmp); // SetIcon creates a new image from the given image cc.SetIcon("b", bmp); Assert.IsFalse(c.Equals(cc)); c.RemoveIcon("b"); cc.RemoveIcon("b"); Assert.IsTrue(c.Equals(cc)); cc.Move("b", 2); Assert.IsTrue(!c.Equals(cc)); }