var type = typeof (Entity); var properties = type.GetProperties( BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public); foreach (var property in properties) { if (property.PropertyType != typeof(DateTimeOffset)) // issues with DateTime in JSON { Assert.AreEqual(property.GetValue(_entity1), property.GetValue(_entity4)); } else { // different at level of Ticks, but not an issue Assert.That(property.GetValue(_entity1), Is.EqualTo(property.GetValue(_entity4)).Within(1).Milliseconds); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)