public void ProcessNullProperty() { string property1Value = null; var source = new SinglePropertyClass() { Property1 = property1Value }; var expected = $"{nameof(SinglePropertyClass)}{{{nameof(SinglePropertyClass.Property1)}={string.Empty}}}"; var actual = ToStringBuilder.ToString(source); Console.WriteLine(actual); Assert.AreEqual(expected, actual); }
public void MemberNaming() { var property1Value = "Property"; var source = new SinglePropertyClass() { Property1 = property1Value }; var expected = $"{nameof(SinglePropertyClass)}{{" + $"NamedProperty={property1Value}}}"; var map = new MemberNamingMap(); var actual = map.ToString(source); Console.WriteLine(actual); Assert.AreEqual(expected, actual); }