Ejemplo n.º 1
0
        public void CanApply_WithIAgeableObject_ReturnsTrue()
        {
            IObject ageable = new TestAgeable();

            bool result = aging.CanApply(ageable, null);

            Assert.IsTrue(result, "Aging should be able to handle an object implementing IAgeable.");
        }
Ejemplo n.º 2
0
        public void Apply_WithIAgeableObject_ReturnsTrue()
        {
            const long AGE_BEFORE_AGEING = 5;
            const long MAX_AGE           = 10;

            TestAgeable ageable = new TestAgeable();

            ageable.Age    = AGE_BEFORE_AGEING;
            ageable.MaxAge = MAX_AGE;

            aging.Apply(ageable, null);

            Assert.AreEqual(ageable.Age, AGE_BEFORE_AGEING + 1, "The age of IAgeable should be increased by 1 after aging.");
        }