Exemplo n.º 1
0
        [TestMethod] //how do I test random nums?
        public void AttentionReplenish_AddsAttentionDecaysRestAndFood_Int()
        {
            TamagotchiPet pet = new TamagotchiPet("Anton");

            pet.AttentionReplenish();
            Assert.AreEqual(100, pet.GetAttention());
        }
Exemplo n.º 2
0
        public ActionResult AddAttention(int id)
        {
            TamagotchiPet pet = TamagotchiPet.Find(id);

            pet.AttentionReplenish();
            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()
            }));
        }