public void WithNullValues_PrintFieldsAsNull() { var dummy = new Dummy(); var results = dummy.FormatProperties(x => x.ObjectProperty); results.Should().Be("{Dummy: 'ObjectProperty':'null', }"); }
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', }"); }
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); } }