コード例 #1
0
        public void Test_Clear_ClearsList()
        {
            var list = new BeatObjectList <BPM>();

            list.Add(new BPM(100, 0));
            list.Add(new BPM(100, 5));
            list.Clear();

            Assert.AreEqual(0, list.Count);
        }
コード例 #2
0
        public void Test_Clear_FiresClearedEvent()
        {
            var list = new BeatObjectList <BPM>();

            list.Add(new BPM(100, 0));
            list.Add(new BPM(100, 5));

            var calls = 0;

            list.Cleared += delegate { calls++; };
            list.Clear();

            Assert.AreEqual(1, calls);
            Assert.AreEqual(0, list.Count);
        }