void ValuesGreaterThan() { var left = new { Value1 = 1, Value2 = 2 }; var right = new { Value1 = 1, Value2 = 0 }; var compare = Cmp.Values(left, right).Check(x => x.Value1).Check(x => x.Value2); Expect((int)compare).Is(1); }
void ValueGreaterThan() { var left = new { Value = 2 }; var right = new { Value = 1 }; var compare = Cmp.Values(left, right).Check(x => x.Value); Expect((int)compare).Is(1); }
void ValuesEqual() { var left = new { Value1 = 1, Value2 = 2 }; var right = new { Value1 = 1, Value2 = 2 }; var compare = Cmp.Values(left, right).Check(x => x.Value1).Check(x => x.Value2); Expect((int)compare).Is(0); }
void ValueEqual() { var left = new { Value = 1 }; var right = new { Value = 1 }; var compare = Cmp.Values(left, right).Check(x => x.Value); Expect((int)compare).Is(0); }
public static bool operator <=(Index x, Index y) => Cmp.Op(x, y) <= 0;
public static bool operator >=(Index x, Index y) => Cmp.Op(x, y) >= 0;
void OpGreaterThan() { Expect(Cmp.Op(2, 1)).Is(1); }
void OpLessThan() { Expect(Cmp.Op(1, 2)).Is(-1); }
void OpEqual() { Expect(Cmp.Op(1, 1)).Is(0); }
void NoValues() { ExpectThrows <InvalidOperationException>(() => (int)Cmp.Values(1, 1)); }
public static bool operator <=(Id x, Id y) => Cmp.Op(x, y) <= 0;
public static bool operator >=(Id x, Id y) => Cmp.Op(x, y) >= 0;
public int CompareTo(Id other) => Cmp.Values(this, other).Check(x => x.ToString());