Example #1
0
        public void EqualsAnyOtherObjectReturnsFalse(
            object other)
        {
            var sut    = new BasketItem("Dummy", 1, 1);
            var actual = sut.Equals(other);

            Assert.False(actual, "Equals should return false.");
        }
Example #2
0
        public void EqualsReturnsCorrectResult(
            string sutName,
            string otherName,
            int sutUnitPrice,
            int otherUnitPrice,
            int sutQuantity,
            int otherQuantity,
            bool expected)
        {
            var sut    = new BasketItem(sutName, sutUnitPrice, sutQuantity);
            var actual = sut.Equals(
                new BasketItem(otherName, otherUnitPrice, otherQuantity));

            Assert.Equal(expected, actual);
        }