Esempio n. 1
0
        public void Test_Add_InsertsObject()
        {
            var list = new BeatObjectList <BPM>();
            var bpm  = new BPM(100, 0);

            list.Add(bpm);
            Assert.AreEqual(1, list.Count);

            var array = list.ToArray();

            Assert.AreSame(array[0], bpm);
        }
Esempio n. 2
0
        public void Test_AddMultiple_ObjectsOutOfOrder()
        {
            var list    = new BeatObjectList <BPM>();
            var objects = new BPM[] {
                new BPM(100, 5),
                new BPM(100, 3),
                new BPM(100, 2),
            };

            list.AddMultiple(objects);

            var array = list.ToArray();

            Assert.AreSame(objects[2], array[0]);
            Assert.AreSame(objects[1], array[1]);
            Assert.AreSame(objects[0], array[2]);
        }
Esempio n. 3
0
        public void Test_ToArray_NonEmptyList()
        {
            var list    = new BeatObjectList <BPM>();
            var objects = new BPM[] {
                new BPM(100, 2),
                new BPM(100, 3),
                new BPM(100, 5),
            };

            list.AddMultiple(objects);

            var array = list.ToArray();

            Assert.AreEqual(objects.Length, array.Length);
            Assert.AreSame(objects[0], array[0]);
            Assert.AreSame(objects[1], array[1]);
            Assert.AreSame(objects[2], array[2]);
        }
Esempio n. 4
0
        public void Test_ToArray_EmptyList()
        {
            var list = new BeatObjectList <BPM>();

            Assert.IsEmpty(list.ToArray());
        }