Example #1
0
 public void TestTamagotchiPlay()
 {
     _tamagotchi = new Tamagotchi();
     _tamagotchi.Play(DefaultValues.Play);
     Assert.IsTrue(_tamagotchi.Happiness == DefaultValues.MaxValue);
     Assert.IsTrue(_tamagotchi.Tiredness == DefaultValues.MinValue + DefaultValues.Play);
 }
Example #2
0
        public void TestTamagotchiSleep()
        {
            _tamagotchi = new Tamagotchi(DefaultValues.MinValue, DefaultValues.MaxValue, DefaultValues.MinValue, DefaultValues.MinValue);
            _tamagotchi.Sleep(DefaultValues.Sleep);

            Assert.IsTrue(_tamagotchi.Tiredness == DefaultValues.MaxValue - DefaultValues.Sleep);
        }
Example #3
0
 public void TestTamagotchiFeed()
 {
     _tamagotchi = new Tamagotchi();
     _tamagotchi.Feed(DefaultValues.Feed);
     Assert.IsTrue(_tamagotchi.Hungriness == DefaultValues.MaxValue - DefaultValues.Feed);
     Assert.IsTrue(_tamagotchi.Fullness == DefaultValues.MinValue + DefaultValues.Feed);
 }
Example #4
0
 public void TestSetup()
 {
     _tamagotchiMock = new Mock <ITamagotchi>();
     _tamagotchiMock.Setup(x => x.Sleep(It.IsAny <int>())).Returns(true);
     _tamagotchiMock.Setup(x => x.Sleep(DefaultValues.MaxValue)).Returns(false);
     _tamagotchiMock.Setup(x => x.Tiredness == 50);
     _tamagotchiObject = _tamagotchiMock.Object;
 }
Example #5
0
        public void TestSetupOfNewTamagotchi()
        {
            _tamagotchi = new Tamagotchi(20, 20, 20, 20);

            Assert.IsTrue(_tamagotchi.Happiness == 20);
            Assert.IsTrue(_tamagotchi.Tiredness == 20);
            Assert.IsTrue(_tamagotchi.Hungriness == 20);
            Assert.IsTrue(_tamagotchi.Fullness == 20);
        }
Example #6
0
        public void TestSetupOfDefaultTamagotchi()
        {
            _tamagotchi = new Tamagotchi();

            Assert.IsTrue(_tamagotchi.Happiness == DefaultValues.MaxValue);
            Assert.IsTrue(_tamagotchi.Tiredness == DefaultValues.MinValue);
            Assert.IsTrue(_tamagotchi.Hungriness == DefaultValues.MaxValue);
            Assert.IsTrue(_tamagotchi.Fullness == DefaultValues.MinValue);
        }
Example #7
0
        public void TestDeadTamagotchiInterval()
        {
            _tamagotchi = new Tamagotchi(DefaultValues.MinValue, DefaultValues.MaxValue, DefaultValues.MaxValue, DefaultValues.MaxValue);
            _tamagotchi.Interval();

            Assert.IsTrue(_tamagotchi.Happiness == DefaultValues.MinValue);
            Assert.IsTrue(_tamagotchi.Tiredness == DefaultValues.MaxValue);
            Assert.IsTrue(_tamagotchi.Hungriness == DefaultValues.MaxValue);
            Assert.IsTrue(_tamagotchi.Fullness == DefaultValues.MaxValue - 1);
        }
Example #8
0
 public void TestTamagotchiPoo()
 {
     _tamagotchi = new Tamagotchi();
     Assert.IsFalse(_tamagotchi.Poop(DefaultValues.Poo));
     Assert.IsTrue(_tamagotchi.Fullness == DefaultValues.MinValue);
 }