Ejemplo n.º 1
0
        public void Adding_2()
        {
            StructArray <Entity> entities = new StructArray <Entity>();
            Entity entity = new Entity()
            {
                id = 2, version = 1
            };

            entities.Add(entity);

            entity.id = 3;
            entities.Add(entity);

            Assert.AreEqual(entities.Count, 2);
        }
Ejemplo n.º 2
0
        public void Removing_1()
        {
            StructArray <Entity> entities = new StructArray <Entity>();
            Entity entity = new Entity()
            {
                id = 2, version = 1
            };

            entities.Add(entity);

            entity.id = 3;
            entities.Add(entity);

            entity.id = 2;
            entities.SwapForLast(entity);

            Assert.AreEqual(entities.Count, 1);
        }
Ejemplo n.º 3
0
        public void Removing_2()
        {
            StructArray <Entity> entities = new StructArray <Entity>();
            Entity entity = new Entity();

            entities.Add(entity);

            entity.id = 1;
            entities.Add(entity);

            entity.id = 2;
            entities.Add(entity);

            entity.id = 3;
            entities.Add(entity);

            entities.SwapForLast(0);

            Assert.AreEqual(entities[0].id, 3);
        }
Ejemplo n.º 4
0
        public void Insert_1()
        {
            StructArray <Entity> entities = new StructArray <Entity>();
            Entity entity = new Entity()
            {
                id = 2, version = 1
            };

            entities.Add(entity);

            entity.id = 3;
            entities.Insert(0, entity);

            Assert.AreEqual(entities[0].id, 3);
        }