public void ClockDataCollectionTest_OneTimeFilter() { // Arrange var f = new MainForm(); var c0 = new TimerData(f.MyDataFile, f.MultiAudioPlayer) { GroupName = "" }; var cTest = new AlarmData(f.MyDataFile, f.MultiAudioPlayer) { GroupName = "test" }; // Act f.MyDataFile.ClockMCollection.AddClocks(c0, cTest); var f1 = new FilterM(f.MyDataFile.ClockMCollection, ""); Assert.AreEqual( f.MyDataFile.ClockMCollection.OneTimeFilter(f1).Count(), 2); var f2 = new FilterM(f.MyDataFile.ClockMCollection, "1"); Assert.AreEqual( f.MyDataFile.ClockMCollection.OneTimeFilter(f2).Count(), 1); var f3 = new FilterM(f.MyDataFile.ClockMCollection, "alarms"); Assert.AreEqual( f.MyDataFile.ClockMCollection.OneTimeFilter(f3).Count(), 1); var f4 = new FilterM(f.MyDataFile.ClockMCollection, "2"); Assert.AreEqual( f.MyDataFile.ClockMCollection.OneTimeFilter(f4).Count(), 2); }
public void ClockDataCollectionTest_ClockSatisfiesFilter() { // Arrange var f = new MainForm(); var c0 = new TimerData(f.MyDataFile, f.MultiAudioPlayer) { GroupName = "" }; var cTest = new AlarmData(f.MyDataFile, f.MultiAudioPlayer) { GroupName = "test" }; // Act f.MyDataFile.ClockMCollection.AddClocks(c0, cTest); var f1 = new FilterM(f.MyDataFile.ClockMCollection, ""); Assert.IsFalse(f1.Autocorrected); Assert.IsTrue(ClockMCollection.ClockSatisfiesFilter(f1, c0)); Assert.IsTrue(ClockMCollection.ClockSatisfiesFilter(f1, cTest)); var f2 = new FilterM(f.MyDataFile.ClockMCollection, "1"); Assert.IsFalse(f2.Autocorrected); Assert.IsFalse(ClockMCollection.ClockSatisfiesFilter(f2, c0)); Assert.IsTrue(ClockMCollection.ClockSatisfiesFilter(f2, cTest)); var f3 = new FilterM(f.MyDataFile.ClockMCollection, "alarms"); Assert.IsFalse(f3.Autocorrected); Assert.IsFalse(ClockMCollection.ClockSatisfiesFilter(f3, c0)); Assert.IsTrue(ClockMCollection.ClockSatisfiesFilter(f3, cTest)); var f4 = new FilterM(f.MyDataFile.ClockMCollection, "2"); Assert.IsTrue(f4.Autocorrected); Assert.IsTrue(ClockMCollection.ClockSatisfiesFilter(f4, c0)); Assert.IsTrue(ClockMCollection.ClockSatisfiesFilter(f4, cTest)); }