public void Serialize_WithMemberFilter () { var instance = new SerializerTestClassWithProperties { PublicProperty1 = 17, PublicProperty2 = "test" }; TestResultSerializer serializer = new TestResultSerializer (_writer, memberInfo => memberInfo.Name.Contains ("1")); serializer.Serialize (instance); var expected = "SerializerTestClassWithProperties" + Environment.NewLine + " PublicProperty1: 17" + Environment.NewLine; Assert.That (_writer.ToString (), Is.EqualTo (expected)); }
public void Serialize_ReferenceType_WithProperties () { var instance = new SerializerTestClassWithProperties { PublicProperty1 = 17, PublicProperty2 = "test" }; _serializer.Serialize (instance); var expected = "SerializerTestClassWithProperties" + Environment.NewLine + " PublicProperty1: 17" + Environment.NewLine + " PublicProperty2: 'test'" + Environment.NewLine; Assert.That (_writer.ToString (), Is.EqualTo (expected)); }