[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 CheckForMax_ChecksIfStatIsHigherThanMax_Int() { TamagotchiPet pet = new TamagotchiPet("Tan"); pet.FoodReplenish(); Assert.AreEqual(100, pet.GetFood()); }
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()); }
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() })); }
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() })); }