public void EqualsWithNestedDifferentRootValueObjectReturnFalse() { NestedValueObject vo1 = new NestedValueObject(); NestedValueObject vo2 = new NestedValueObject(); vo1.i = 1; vo1.s = "s"; vo1.n = new SimpleValueObject(); vo1.n.i = 2; vo1.n.s = "s"; vo2.i = 3; vo2.s = "s"; vo2.n = new SimpleValueObject(); vo2.n.i = 2; vo2.n.s = "s"; var equality = vo1.Equals(vo2); Assert.AreEqual(false, equality); }
public void EqualsWithNestedValueObjectReturnTrue() { NestedValueObject vo1 = new NestedValueObject(); NestedValueObject vo2 = new NestedValueObject(); vo1.i = 1; vo1.s = "s"; vo1.n = new SimpleValueObject(); vo1.n.i = 2; vo1.n.s = "s"; vo2.i = 1; vo2.s = "s"; vo2.n = new SimpleValueObject(); vo2.n.i = 2; vo2.n.s = "s"; var equality = vo1.Equals(vo2); Assert.AreEqual(true, equality); }