Example #1
0
        public void SingleLongEcsSignature_WhenEnableBit_SetsBit()
        {
            // Arrange
            var signature1 = new SingleLongEcsSignature();
            var signature2 = new SingleLongEcsSignature();
            var signature3 = new SingleLongEcsSignature();

            // Act
            signature1.EnableBit(63);
            signature2.EnableBit(0);
            signature3.EnableBit(63);

            // Assert
            Assert.IsTrue(signature1.IsMatching(signature3));
            Assert.IsFalse(signature1.IsMatching(signature2));
        }
Example #2
0
        public void SingleLongEcsSignature_WhenEnableBit_CreatesUniqueSignature()
        {
            // Arrange
            var signatures = new SingleLongEcsSignature[64];

            // Act
            for (var index = 0; index < signatures.Length; ++index)
            {
                var signature = new SingleLongEcsSignature();
                signature.EnableBit(index);
                signatures[index] = signature;
            }

            // Assert
            int i = 0;
            var matchingSignatures = signatures.Where(x =>
            {
                ++i;
                return(i < signatures.Length && x.IsMatching(signatures[i]));
            });

            Assert.AreEqual(0, matchingSignatures.Count());
        }