public void ValueObjectWithIntegerListIsComparableByValueUsingTheEqualsMethod() { var testObjectOne = new TestObjectWithIntegerList(); var testObjectTwo = new TestObjectWithIntegerList(); Assert.AreEqual(testObjectOne, testObjectTwo); testObjectTwo.TestListOfIntegers.Add(55); Assert.AreNotEqual(testObjectOne, testObjectTwo); }
public void ValueObjectWithIntegerListIsComparableByValueUsingOperators() { var testObjectOne = new TestObjectWithIntegerList(); var testObjectTwo = new TestObjectWithIntegerList(); Assert.IsTrue(testObjectOne == testObjectTwo); testObjectTwo.TestListOfIntegers.Add(55); Assert.IsTrue(testObjectOne != testObjectTwo); }
public void ValueObjectWithIntegerListPropertyWorksWithHashSet() { var hashSet = new HashSet <TestObjectWithIntegerList>(); var testObjectOne = new TestObjectWithIntegerList(); var testObjectTwo = new TestObjectWithIntegerList(); hashSet.Add(testObjectOne); hashSet.Add(testObjectTwo); Assert.IsTrue(hashSet.Count == 1); }