示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
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);
        }
示例#5
0
 void NoValues()
 {
     ExpectThrows <InvalidOperationException>(() => (int)Cmp.Values(1, 1));
 }
示例#6
0
文件: Id.cs 项目: promontis/Totem
 public int CompareTo(Id other) =>
 Cmp.Values(this, other).Check(x => x.ToString());