Пример #1
0
        public void Equals_ReturnsTrue_ForEqualKnapsackItems()
        {
            var e1 = new KnapsackItem <char>('a', 1, 2);
            var e2 = new KnapsackItem <char>('a', 1, 2);

            Assert.IsTrue(e1.Equals(e2));
        }
Пример #2
0
        public void Equals_ReturnsFalse_ForNonEqualWeights()
        {
            var e1 = new KnapsackItem <char>('a', 1, 2);
            var e2 = new KnapsackItem <char>('a', 1, 3);

            Assert.IsFalse(e1.Equals(e2));
        }
Пример #3
0
        public void Equals_ReturnsFalse_ForNullObject()
        {
            var e1 = new KnapsackItem <char>('a', 1, 2);

            Assert.IsFalse(e1.Equals(null));
        }