Extensibility point for object equality managed by IComparisonSemantics.
Namespace:
Gallio.FrameworkAssembly: Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)
Syntax
| C# |
|---|
public class CustomEqualityComparers |
| Visual Basic (Declaration) |
|---|
Public Class CustomEqualityComparers |
Remarks
Use the methods Register(Type, EqualityComparison) and Unregister(Type) to add and remove custom type equality comparers.
The Gallio inner comparison engine handles with the case of null objects comparison prior to the custom comparers. Therefore, while defining a custom comparer, you can safely assume that the objects to compare are never null.
Examples
public interface IFoo { int Value { get; } } var customEqualityComparers = new CustomEqualityComparers(); customEqualityComparers.Register<IFoo>((x, y) => x.Value == y.Value);
