Exemplo n.º 1
0
        public void PrimitiveKeyInfoIsEmpty()
        {
            var keyInfo = PrimitiveKeyInfo.Create((Member g) => g.GroupId);

            Assert.IsTrue(keyInfo.IsEmptyKey(null));
            Assert.IsFalse(keyInfo.IsEmptyKey(1));
        }
Exemplo n.º 2
0
        public void PrimitiveKeyInfoComparer()
        {
            var keyInfo  = PrimitiveKeyInfo.Create((Member g) => g.GroupId);
            var comparer = keyInfo.KeyComparer;

            Assert.AreEqual(0, comparer.Compare(null, null));
            Assert.AreEqual(-1, comparer.Compare(null, 1));
            Assert.AreEqual(1, comparer.Compare(1, null));

            Assert.AreEqual(0, comparer.Compare(1, 1));
            Assert.AreEqual(-1, comparer.Compare(0, 1));
            Assert.AreEqual(1, comparer.Compare(1, 0));
        }
Exemplo n.º 3
0
        public void PrimitiveKeyInfoCreation()
        {
            var keyInfo = PrimitiveKeyInfo.Create((Group g) => g.Id);

            Assert.AreEqual(1, keyInfo.EntityKeyMembers.Length);
        }