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

            pet.SetName("Tamagot");
            Assert.AreEqual("Tamagotchi", pet.GetName());
        }
示例#2
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()
            }));
        }
示例#3
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()
            }));
        }