예제 #1
0
        public void URI_id_should_be_more_than_blank_id()
        {
            // given
            const string Id = "urn:test:identifier";

            // when
            IComparable entityId1 = new EntityId(Id);
            IComparable entityId2 = new BlankId("blank1", (EntityId)entityId1);

            Assert.That(entityId1.CompareTo(entityId2), Is.GreaterThan(0));
        }
예제 #2
0
        public void Two_instances_should_be_equal_when_compared()
        {
            // given
            const string Id = "urn:test:identifier";

            // when
            IComparable entityId1 = new EntityId(Id);
            var entityId2 = new EntityId(Id);

            Assert.That(entityId1.CompareTo(entityId2), Is.EqualTo(0));
        }
예제 #3
0
        public void URI_id_should_be_more_than_blank_id()
        {
            // given
            const string Id = "urn:test:identifier";

            // when
            IComparable entityId1 = new EntityId(Id);
            IComparable entityId2 = new BlankId("blank1", (EntityId)entityId1);

            Assert.That(entityId1.CompareTo(entityId2), Is.GreaterThan(0));
        }
예제 #4
0
        public void Two_instances_should_be_equal_when_compared()
        {
            // given
            const string Id = "urn:test:identifier";

            // when
            IComparable entityId1 = new EntityId(Id);
            var         entityId2 = new EntityId(Id);

            Assert.That(entityId1.CompareTo(entityId2), Is.EqualTo(0));
        }
예제 #5
0
파일: EntityProxy.cs 프로젝트: ewin66/Forge
        /// <summary>
        /// Compares to.
        /// </summary>
        /// <param name="o">The o.</param>
        /// <returns></returns>
        public virtual int CompareTo(EntityProxy o)
        {
            if (o == null)
            {
                ThrowHelper.ThrowArgumentNullException("o");
            }
            int result = mEntityType.AssemblyQualifiedName.CompareTo(o.EntityType.AssemblyQualifiedName);

            if (result == 0)
            {
                result = mEntityId.CompareTo(o.EntityId);
            }
            return(result);
        }
예제 #6
0
 public int CompareTo(EntityData other)
 {
     return(EntityId.CompareTo(other.EntityId));
 }