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)); }
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)); }
/// <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); }
public int CompareTo(EntityData other) { return(EntityId.CompareTo(other.EntityId)); }