Example #1
0
        public void Rules_AthleticRule_Value()
        {
            var        dateTime = new DateTime(1994, 1, 5, 10, 10, 10);
            Tamagotchi t        = new Tamagotchi(0, 21, 0, 0, dateTime, TimeSpan.Zero);

            Rule rule = new AthleticRule();

            rule.Execute(t, dateTime);
            Assert.IsFalse(t.IsAthletic);

            t.HugAction(dateTime);
            rule.Execute(t, dateTime);

            Assert.IsTrue(t.IsAthletic);
        }
Example #2
0
        public void Rules_StarvationRule_DoNothingIsAthletic()
        {
            var        dateTime = new DateTime(1994, 1, 5, 10, 10, 10);
            Tamagotchi t        = new Tamagotchi(0, 0, 95, 0, dateTime, TimeSpan.Zero);

            Rule rule = new SleepDeprivationRule();
            Rule hun  = new HungerRule();
            Rule ath  = new AthleticRule();

            ath.Execute(t, dateTime);
            rule.Execute(t, dateTime);
            Assert.IsFalse(t.HasDied);

            hun.Execute(t, dateTime + TimeSpan.FromHours(2));
            rule.Execute(t, dateTime + TimeSpan.FromHours(2));
            Assert.IsFalse(t.HasDied);
        }