예제 #1
0
        public void TestToStringSingleKey()
        {
            var obj1   = new Sample1();
            var helper = new EqualityHelper <Sample1>(x => x.IntProp);

            obj1.IntProp = 123;

            helper.ObjectToString(obj1).Should().Be("(IntProp=123)");
        }
예제 #2
0
        public void TestToStringMultipleKeyWithNullKey()
        {
            var obj1   = new Sample1();
            var helper = new EqualityHelper <Sample1>(x => x.IntProp, x => x.StringProp);

            obj1.IntProp    = 123;
            obj1.StringProp = null;

            helper.ObjectToString(obj1).Should().Be("(IntProp=123 | StringProp=<null>)");
        }