public void GetHashCode_ReturnsDifferentHashCodes_ForDifferentValues() { var e1 = new KnapsackItem <char>('a', 1, 2); var e2 = new KnapsackItem <char>('a', 2, 2); Assert.AreNotEqual(e1.GetHashCode(), e2.GetHashCode()); }
public void GetHashCode_ReturnsEqualHashCodes_ForEqualKnapsackItems() { var e1 = new KnapsackItem <char>('a', 1, 2); var e2 = new KnapsackItem <char>('a', 1, 2); Assert.AreEqual(e1.GetHashCode(), e2.GetHashCode()); }