コード例 #1
0
ファイル: CmpSpecs.cs プロジェクト: snickroger/Totem
        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
ファイル: CmpSpecs.cs プロジェクト: snickroger/Totem
        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
ファイル: CmpSpecs.cs プロジェクト: snickroger/Totem
        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
ファイル: CmpSpecs.cs プロジェクト: snickroger/Totem
        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
ファイル: CmpSpecs.cs プロジェクト: snickroger/Totem
 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());