public void ValueObjectWithStringListIsComparableByValueUsingOperators() { var testObjectOne = new TestObjectWithStringList(); var testObjectTwo = new TestObjectWithStringList(); Assert.IsTrue(testObjectOne == testObjectTwo); testObjectTwo.TestListOfStrings.Add("Hello World!"); Assert.IsTrue(testObjectOne != testObjectTwo); }
public void ValueObjectWithStringListIsComparableByValueUsingTheEqualsMethod() { var testObjectOne = new TestObjectWithStringList(); var testObjectTwo = new TestObjectWithStringList(); Assert.AreEqual(testObjectOne, testObjectTwo); testObjectTwo.TestListOfStrings.Add("Hello World!"); Assert.AreNotEqual(testObjectOne, testObjectTwo); }
public void ValueObjectWithStringListPropertyWorksWithHashSet() { var hashSet = new HashSet <TestObjectWithStringList>(); var testObjectOne = new TestObjectWithStringList(); var testObjectTwo = new TestObjectWithStringList(); hashSet.Add(testObjectOne); hashSet.Add(testObjectTwo); Assert.IsTrue(hashSet.Count == 1); }