public static void AssertIsEqual(ModelWithIdAndName actual, ModelWithIdAndName expected) { if (actual == null || expected == null) { Assert.That(actual == expected, Is.True); return; } Assert.That(actual.Id, Is.EqualTo(expected.Id)); Assert.That(actual.Name, Is.EqualTo(expected.Name)); }
public bool Equals(ModelWithIdAndName other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.Id == Id && Equals(other.Name, Name); }