Exemple #1
0
        public void EntityIsNotChangedIfOriginalDoesNotHaveComponents()
        {
            _originalEntity.CopyTo(_targetEntity);

            Assert.AreEqual(0, _originalEntity.CreationIndex);
            Assert.AreEqual(1, _targetEntity.CreationIndex);
            Assert.IsEmpty(_targetEntity.GetComponents());
        }
        public void EntityIsNotChangedIfOriginalDoesNotHaveComponents()
        {
#pragma warning disable CS0618  // Type or member is obsolete
#pragma warning disable HAA0101 // Array allocation for params parameter
            _entity.CopyTo(_target);
#pragma warning restore HAA0101 // Array allocation for params parameter
#pragma warning restore CS0618  // Type or member is obsolete

            Assert.AreEqual(0, _entity.CreationIndex);
            Assert.AreEqual(1, _target.CreationIndex);
            Assert.IsEmpty(_target.GetComponents());
        }
Exemple #3
0
        private void AssertHasNotComponentA(MyTestEntity e)
        {
            var components = e.GetComponents();

            Assert.AreEqual(0, components.Length);

            var indices = e.GetComponentIndices();

            Assert.AreEqual(0, indices.Length);
            Assert.IsFalse(e.HasComponentA());
            Assert.IsFalse(e.HasComponents(_indicesA));
            Assert.IsFalse(e.HasAnyComponent(_indicesA));
        }
Exemple #4
0
        private void AssertHasComponentA(MyTestEntity e, IComponent componentA = null)
        {
            if (componentA == null)
            {
                componentA = Component.A;
            }

            Assert.AreEqual(componentA, e.GetComponentA());

            var components = e.GetComponents();

            Assert.AreEqual(1, components.Length);
            Assert.Contains(componentA, components);

            var indices = e.GetComponentIndices();

            Assert.AreEqual(1, indices.Length);
            Assert.Contains(MyTestComponentsLookup.ComponentA, indices);

            Assert.IsTrue(e.HasComponentA());
            Assert.IsTrue(e.HasComponents(_indicesA));
            Assert.IsTrue(e.HasAnyComponent(_indicesA));
        }
Exemple #5
0
 public void ValidateInitialComponentAreEmpty()
 {
     Assert.IsEmpty(_defaultEntity.GetComponents());
 }