public void SetGetIsDead_SetsGetsIsDead_Bool()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.SetIsDead(true);
            Assert.AreEqual(true, pet.GetIsDead());
        }
        public void IncrementGetNextLevel_IncrementsGetsNextLevel_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.IncrementNextLevel();
            Assert.AreEqual(10, pet.GetNextLevel());
        }
        [TestMethod] //how do I test random nums?
        public void AttentionReplenish_AddsAttentionDecaysRestAndFood_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.AttentionReplenish();
            Assert.AreEqual(100, pet.GetAttention());
        }
        [TestMethod] //fix this - how do I test random nums?
        public void FoodDecay_SubtractsFood_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.FoodDecay();
            Assert.AreEqual(pet.GetFood(), pet.GetFood());
        }
        public void SetGetName_ReturnsName_String()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.SetName("Tamagot");
            Assert.AreEqual("Tamagotchi", pet.GetName());
        }
        public void SetGetReplenishValue_SetsGetsReplenishValue_Int()
        {
            TamagotchiPet pet     = new TamagotchiPet("Anton");
            int           randNum = pet.GetReplenishValue(1, 5);

            Assert.AreEqual(randNum, pet.GetReplenishValue(1, 5));
        }
        [TestMethod] //how do I test random nums?
        public void AttentionDecay_SubtractsAttention_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.AttentionDecay();
            Assert.AreEqual(pet.GetAttention(), pet.GetAttention());
        }
        [TestMethod] //how do I test random nums?
        public void RestDecay_SubtractsRest_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.RestDecay();
            Assert.AreEqual(pet.GetRest(), pet.GetRest());
        }
        public void LevelUpGetLevel_GetsSetsLevel_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.LevelUp();
            Assert.AreEqual(2, pet.GetLevel());
        }
Esempio n. 10
0
        public void SetBuryGetIsBuried_GetsSetsBuried_True()
        {
            TamagotchiPet pet = new TamagotchiPet("Tan");

            pet.Bury();
            Assert.AreEqual(true, pet.IsBuried());
        }
Esempio n. 11
0
        public void CheckExp_AddExpWhenPetIsAlive_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Bit");

            pet.CheckExp();
            Assert.AreEqual(1, pet.GetExp());
        }
Esempio n. 12
0
        public void CheckForMax_ChecksIfStatIsHigherThanMax_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Tan");

            pet.FoodReplenish();
            Assert.AreEqual(100, pet.GetFood());
        }
Esempio n. 13
0
        public void AddExpGetExp_AddsExpAndGetsExp_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.AddExp();
            pet.AddExp();
            Assert.AreEqual(2, pet.GetExp());
        }
Esempio n. 14
0
        public void DisplayPetData_ReturnsCorrectView_True()
        {
            TamagotchiPet  pet            = new TamagotchiPet("Gandalf");
            HomeController controller     = new HomeController();
            ActionResult   DisplayPetData = controller.DisplayPetData(1);

            Assert.IsInstanceOfType(DisplayPetData, typeof(ViewResult));
        }
Esempio n. 15
0
        public void CheckExp_DoesNotAddExpWhenPetIsDead_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Bit");

            pet.SetIsDead(true);
            pet.CheckExp();
            Assert.AreEqual(0, pet.GetExp());
        }
Esempio n. 16
0
        public void DisplayPetData_HasCorrectModelType_Account()
        {
            TamagotchiPet pet            = new TamagotchiPet("Gandalf");
            ViewResult    DisplayPetData = new HomeController().DisplayPetData(1) as ViewResult;
            var           result         = DisplayPetData.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(List <TamagotchiPet>));
        }
Esempio n. 17
0
        public void BuryPet_ReturnsCorrectView_True()
        {
            TamagotchiPet  pet        = new TamagotchiPet("Balrog");
            HomeController controller = new HomeController();
            ActionResult   BuryPet    = controller.BuryPet(1);

            Assert.IsInstanceOfType(BuryPet, typeof(ViewResult));
        }
Esempio n. 18
0
        public void BuryPet_HasCorrectModelType_Account()
        {
            TamagotchiPet pet     = new TamagotchiPet("Sauron");
            ViewResult    BuryPet = new HomeController().BuryPet(1) as ViewResult;
            var           result  = BuryPet.ViewData.Model;

            Assert.IsInstanceOfType(result, typeof(List <TamagotchiPet>));
        }
Esempio n. 19
0
        public void FoodReplenish_AddsFoodAttentionAndRest_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.FoodReplenish();
            Assert.AreEqual(100, pet.GetFood());
            Assert.AreEqual(100, pet.GetAttention());
            Assert.AreEqual(100, pet.GetRest());
        }
Esempio n. 20
0
        public void SetGetDecayValue_SetsGetsDecayValue_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.SetDecayValue();
            int randNum = pet.GetDecayValue();

            Assert.AreEqual(randNum, pet.GetDecayValue());
        }
Esempio n. 21
0
        public ActionResult BuryPet(int id)
        {
            TamagotchiPet pet = TamagotchiPet.Find(id);

            pet.Bury();
            List <TamagotchiPet> allPets = TamagotchiPet.GetAll();

            return(View("DisplayPetData", allPets));
        }
Esempio n. 22
0
        public ActionResult Decay()
        {
            List <TamagotchiPet> allPets = TamagotchiPet.GetAll();

            foreach (TamagotchiPet pet in allPets)
            {
                pet.RunLifeCycle();
            }
            return(View("DisplayPetData", allPets));
        }
Esempio n. 23
0
        public ActionResult DisplayPetData(int id)
        {
            TamagotchiPet        pet           = TamagotchiPet.Find(id);
            List <TamagotchiPet> singlePetList = new List <TamagotchiPet>()
            {
                pet
            };

            return(View(singlePetList));
        }
Esempio n. 24
0
        public void CheckForLevel_DoesNotAddLevelDoesNotResetExpWhenPetIsDead_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Bit");

            pet.AddExp();
            pet.SetIsDead(true);
            pet.CheckForLevel();
            Assert.AreEqual(1, pet.GetLevel());
            Assert.AreEqual(1, pet.GetExp());
        }
Esempio n. 25
0
        public void GetAll_GetsAllInstancesOfTamagotchiPet_List()
        {
            TamagotchiPet        pet1 = new TamagotchiPet("Antony");
            TamagotchiPet        pet2 = new TamagotchiPet("Jonathon");
            TamagotchiPet        pet3 = new TamagotchiPet("Karamo");
            List <TamagotchiPet> TamagotchiPetList = new List <TamagotchiPet> {
                pet1, pet2, pet3
            };

            CollectionAssert.AreEqual(TamagotchiPetList, TamagotchiPet.GetAll());
        }
Esempio n. 26
0
        public void CheckVitals_ChecksIfPetIsDead_Bool()
        {
            TamagotchiPet pet = new TamagotchiPet("Tan");

            for (int i = 0; i < 20; i++)
            {
                pet.FoodDecay();
            }
            pet.CheckVitals();
            Assert.AreEqual(true, pet.GetIsDead());
        }
Esempio n. 27
0
        public void CheckForLevel_AddsLevelAndResetsExpWhenPetIsAlive_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Bit");

            for (int i = 0; i < 5; i++)
            {
                pet.AddExp();
            }
            pet.CheckForLevel();
            Assert.AreEqual(2, pet.GetLevel());
            Assert.AreEqual(0, pet.GetExp());
        }
Esempio n. 28
0
        public void ClearAll_ClearsAllInstancesOfBasket_Int()
        {
            TamagotchiPet pet1 = new TamagotchiPet("Antony");
            TamagotchiPet pet2 = new TamagotchiPet("Jonathon");
            TamagotchiPet pet3 = new TamagotchiPet("Karamo");

            TamagotchiPet.ClearAll();
            List <TamagotchiPet> emptyList = new List <TamagotchiPet>()
            {
            };

            CollectionAssert.AreEqual(emptyList, TamagotchiPet.GetAll());
        }
Esempio n. 29
0
        public ActionResult CreatePet(string name)
        {
            TamagotchiPet pet = new TamagotchiPet(name);

            return(Json(new {
                name = pet.GetName(),
                level = pet.GetLevel(),
                exp = pet.GetExp(),
                nextLevel = pet.GetNextLevel(),
                id = pet.GetId(),
                food = pet.GetFood(),
                attention = pet.GetAttention(),
                rest = pet.GetRest()
            }));
        }
Esempio n. 30
0
        public ActionResult AddRest(int id)
        {
            TamagotchiPet pet = TamagotchiPet.Find(id);

            pet.RestReplenish();
            return(Json(new {
                name = pet.GetName(),
                level = pet.GetLevel(),
                exp = pet.GetExp(),
                nextLevel = pet.GetNextLevel(),
                id = pet.GetId(),
                food = pet.GetFood(),
                attention = pet.GetAttention(),
                rest = pet.GetRest()
            }));
        }