예제 #1
0
        public void TestImmutabilityWhenChangingExpirationDate()
        {
            DiscountByDate original = new DiscountByDate(.1m, DateTime.Now);
            DiscountByDate verifier = new DiscountByDate(original);
            DiscountByDate extended = original.ExtendByDays(7);

            Assert.IsFalse(original.Equals(extended));
            Assert.IsTrue(original.Equals(verifier));
        }
예제 #2
0
        public void TestMatchSameValues()
        {
            DiscountByDate discount          = new DiscountByDate(.1m, DateTime.Now);
            DiscountByDate identicalDiscount = new DiscountByDate(discount);

            Assert.IsTrue(discount.Equals(identicalDiscount));
        }
예제 #3
0
        public void TestMatchDifferentValues()
        {
            DiscountByDate discount          = new DiscountByDate(.1m, DateTime.Now);
            DiscountByDate differentDiscount = new DiscountByDate(.1m, DateTime.Today);

            Assert.IsFalse(discount.Equals(differentDiscount));
        }
예제 #4
0
        public void TestMatchSameDateObject()
        {
            DiscountByDate discount = new DiscountByDate(.1m, DateTime.Now);

            Assert.IsTrue(discount.Equals(discount));
        }