예제 #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());