public void Compare_LessThanValueTypeComparisonSecondValueNull_ReturnsGreaterThanZero() { var x = 11; var actual = Evaluate.Compare(x, null); Assert.IsTrue(actual < 0); }
public void Compare_LessThanValueTypeComparisonSecondValueNullForOverload_ReturnsGreaterThanZero() { object x = 11; var actual = Evaluate.Compare(x, null); Assert.IsTrue(actual > 0); }
public void Compare_LessThanValueTypeComparisonFirstValueNull_ReturnsLessThanZero() { object y = 11; var actual = Evaluate.Compare(null, y); Assert.IsTrue(actual < 0); }
public void Compare_EqualValueTypeComparison_ReturnsZero() { var x = 11; object y = 11; var actual = Evaluate.Compare(x, y); Assert.IsTrue(actual == 0); }
public void Compare_GreaterThanValueTypeComparison_ReturnsGreaterThanZero() { var x = 12; object y = 11; var actual = Evaluate.Compare(x, y); Assert.IsTrue(actual > 0); }
public void Compare_LessThanValueTypeComparison_ReturnsLessThanZero() { var x = 10; object y = 11; var actual = Evaluate.Compare(x, y); Assert.IsTrue(actual < 0); }
/// <summary> /// Compares the current object with another object of the same type. /// </summary> /// <returns> /// A value that indicates the relative order of the objects being compared. The return value has the following /// meanings: Value Meaning Less than zero This object is less than the <paramref name="other"/> parameter.Zero This /// object is equal to <paramref name="other"/>. Greater than zero This object is greater than <paramref name="other"/>. /// </returns> /// <param name="other"> /// An object to compare with this object. /// </param> public int CompareTo(EntityLocation other) { return(Evaluate.Compare( this, other, location => location.EntityType.FullName, location => location.EntityType.AssemblyQualifiedName, location => location.Container, location => location.Name, location => location.Alias, location => location.IsVirtual)); }
public void Compare_EqualObjectTypeComparisonExceptNonComparedProperty_ReturnsZero() { var x = new ComparisonClass { Compared = 11, AlsoCompared = "Compare1", NotCompared = 239 }; var y = new ComparisonClass { Compared = 11, AlsoCompared = "Compare1", NotCompared = 432532 }; var actual = Evaluate.Compare(x, y, c => c.Compared, c => c.AlsoCompared); Assert.IsTrue(actual == 0); }
public void Compare_GreaterThanObjectTypeComparisonSecondExpressionLessThan_ReturnsGreaterThanZero() { var x = new ComparisonClass { Compared = 12, AlsoCompared = "Compare1", NotCompared = 239 }; var y = new ComparisonClass { Compared = 11, AlsoCompared = "Compare2", NotCompared = 94353 }; var actual = Evaluate.Compare(x, y, c => c.Compared, c => c.AlsoCompared); Assert.IsTrue(actual > 0); }
public void Compare_LessThanObjectTypeComparisonFirstExpressionLessThan_ReturnsLessThanZero() { var x = new ComparisonClass { Compared = 10, AlsoCompared = "Compare1", NotCompared = 239 }; var y = new ComparisonClass { Compared = 11, AlsoCompared = "Compare1", NotCompared = 94353 }; var actual = Evaluate.Compare(x, y, c => c.Compared, c => c.AlsoCompared); Assert.IsTrue(actual < 0); }
/// <summary> /// Compares the current object with another object of the same type. /// </summary> /// <returns> /// A value that indicates the relative order of the objects being compared. The return value has the following /// meanings: Value Meaning Less than zero This object is less than the <paramref name="other"/> parameter.Zero This /// object is equal to <paramref name="other"/>. Greater than zero This object is greater than <paramref name="other"/>. /// </returns> /// <param name="other"> /// An object to compare with this object. /// </param> public int CompareTo(UnifiedField other) { return(Evaluate.Compare(this, other, ComparisonProperties)); }
/// <summary> /// Compares the current instance with another object of the same type and returns an integer that indicates /// whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. /// </summary> /// <returns> /// A value that indicates the relative order of the objects being compared. The return value has these meanings: /// Value Meaning Less than zero This instance precedes <paramref name="obj"/> in the sort order. Zero This instance /// occurs in the same position in the sort order as <paramref name="obj"/>. Greater than zero This instance follows /// <paramref name="obj"/> in the sort order. /// </returns> /// <param name="obj"> /// An object to compare with this instance. /// </param> /// <exception cref="ArgumentException"> /// <paramref name="obj"/> is not the same type as this instance. /// </exception> /// <filterpriority>2</filterpriority> public int CompareTo(object obj) { return(Evaluate.Compare(this, obj)); }
/// <summary> /// Compares the current object with another object of the same type. /// </summary> /// <returns> /// A value that indicates the relative order of the objects being compared. The return value has the following meanings: /// Value Meaning Less than zero This object is less than the <paramref name="other"/> parameter.Zero This object is equal /// to <paramref name="other"/>. Greater than zero This object is greater than <paramref name="other"/>. /// </returns> /// <param name="other"> /// An object to compare with this object. /// </param> public int CompareTo(DocumentVersion other) { return(Evaluate.Compare(this, other, ComparisonProperties)); }
/// <summary> /// When overridden in a derived class, performs a comparison of two objects of the same type and returns a value /// indicating whether one object is less than, equal to, or greater than the other. /// </summary> /// <returns> /// A signed integer that indicates the relative values of <paramref name="x" /> and <paramref name="y" />, as shown in the /// following table.Value Meaning Less than zero <paramref name="x" /> is less than <paramref name="y" />.Zero /// <paramref name="x" /> equals <paramref name="y" />.Greater than zero <paramref name="x" /> is greater than /// <paramref name="y" />. /// </returns> /// <param name="x">The first object to compare.</param> /// <param name="y">The second object to compare.</param> public override int Compare(DocumentVersion x, DocumentVersion y) { return(Evaluate.Compare(x, y, version => version.VersionNumber)); }
public void Compare_EqualValueTypeComparisonBothValuesNullGenericMethod_ReturnsZero() { var actual = Evaluate.Compare <string>(null, null); Assert.IsTrue(actual == 0); }
/// <summary> /// Compares the current object with another object of the same type. /// </summary> /// <returns> /// A value that indicates the relative order of the objects being compared. The return value has the following /// meanings: Value Meaning Less than zero This object is less than the <paramref name="other"/> parameter.Zero This /// object is equal to <paramref name="other"/>. Greater than zero This object is greater than <paramref name="other"/>. /// </returns> /// <param name="other"> /// An object to compare with this object. /// </param> public int CompareTo(EntityAttributeDefinition other) { return(Evaluate.Compare(this, other, ComparisonProperties)); }