public void Does_map_only_properties_with_specified_Attribute() { var user = new User { FirstName = "Demis", LastName = "Bellot", Car = new Car { Name = "BMW X6", Age = 3 } }; var to = new User(); to.PopulateFromPropertiesWithAttribute(user, typeof(DataMemberAttribute)); Assert.That(to.LastName, Is.EqualTo(user.LastName)); Assert.That(to.FirstName, Is.Null); Assert.That(to.Car, Is.Null); }
public void Does_map_only_properties_with_specified_Attribute() { var user = new User { FirstName = "Demis", LastName = "Bellot", Car = new Car { Name = "BMW X6", Age = 3 } }; var to = new User(); to.PopulateFromPropertiesWithAttribute(user, typeof(DataMemberAttribute)); Assert.That(to.LastName, Is.EqualTo(user.LastName)); Assert.That(to.FirstName, Is.Null); Assert.That(to.Car, Is.Null); }