Closed GoogleCodeExporter closed 9 years ago
The test: [Test] public void Equality_DifferentReferences_SameValues_True() { var vo1 = new DummyValueType { Id = 1, Name = "Luis" }; var vo2 = new DummyValueType { Id = 1, Name = "Luis" }; Assert.That(vo1, Is.Not.SameAs(vo2)); Assert.That(vo1, Is.EqualTo(vo2)); Assert.That(vo1.Equals(vo2)); //Assert.That(vo1 == vo2); --------------> FAIL, NOT IMPLEMENTED } The fix: /// <summary>op==</summary> public static bool operator ==(ValueObject lhs, ValueObject rhs) { if ((object) lhs == null) return (object) rhs == null; return lhs.Equals(rhs); } /// <summary>op!=</summary> public static bool operator !=(ValueObject lhs, ValueObject rhs) { return !(lhs == rhs); }
Original issue reported on code.google.com by wmccaffe...@gmail.com on 17 Feb 2009 at 4:11
wmccaffe...@gmail.com
Completed and checked in.
Original comment by wmccaffe...@gmail.com on 7 Mar 2009 at 10:47
Original issue reported on code.google.com by
wmccaffe...@gmail.com
on 17 Feb 2009 at 4:11