public void ClockGroupCollectionTest_Rename() { 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); Assert.IsTrue(c.Rename("g1", "g2")); Assert.IsFalse(c.Contains("g1")); Assert.IsTrue(c.Contains("g2")); }
public void ClockGroupCollectionTest_Add() { var mf = new MainForm(); var df = mf.MyDataFile; var d = new ClockVMCollection.Model(df); ClockGroupMCollection c = d.Groups; Assert.IsTrue(c.Add("g1")); Assert.IsFalse(c.Add("g1")); Assert.IsTrue(c.Contains("g1")); Assert.IsTrue(d.IsUnsaved); }
public void ClockGroupCollectionTest_Remove() { 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); Assert.IsTrue(c.Remove("g1")); Assert.IsFalse(c.Contains("g1")); Assert.IsTrue(!c.Icons.ContainsKey("g1") || c.Icons["g1"] == null); Assert.AreEqual("", cl.GroupName); }