public void OfSameCountSetsWithSameFirstItem_ShouldHaveSameHashCode() { var firstSet = new HashSet <string> { "1" }; var secondSet = new HashSet <string> { "1" }; var firstByValue = new SetByValue <string>(firstSet, Options); var secondByValue = new SetByValue <string>(secondSet, Options); Assert.AreEqual(firstByValue.GetHashCode(), secondByValue.GetHashCode()); }
public void OfSetWithNotComparableItems_ShouldNotThrowWhenGetHashCode() { var set = new HashSet <NotComparableClass>(new[] { new NotComparableClass(), new NotComparableClass() }); var byValue = new SetByValue <NotComparableClass>( set, new Options <NotComparableClass>(false, null)); Assert.DoesNotThrow(() => byValue.GetHashCode()); }