예제 #1
0
        public void WithNullValues_PrintFieldsAsNull()
        {
            var dummy = new Dummy();
            var results = dummy.FormatProperties(x => x.ObjectProperty);

            results.Should().Be("{Dummy: 'ObjectProperty':'null', }");
        }
예제 #2
0
        public void WithDefinedProperties_PrintValuesAndNamesCorrectly()
        {
            var dummy = new Dummy {StringProperty = "StringProperty value", IntProperty = 10};
            var results = dummy.FormatProperties(x => x.StringProperty, x => x.IntProperty);

            results.Should().Be("{Dummy: 'StringProperty':'StringProperty value', 'IntProperty':'10', }");
        }
예제 #3
0
 private void TestExpressionVersion(Dummy targetObject, int count)
 {
     for (int i = 0; i < count; i++)
     {
         var devNull = targetObject.FormatProperties(
             x => x.IntProperty,
             x => x.ObjectProperty,
             x => x.StringProperty);
     }
 }