Exemplo n.º 1
0
        public ActionResult BuryPet(int id)
        {
            TamagotchiPet pet = TamagotchiPet.Find(id);

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

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

            foreach (TamagotchiPet pet in allPets)
            {
                pet.RunLifeCycle();
            }
            return(View("DisplayPetData", allPets));
        }
Exemplo n.º 3
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());
        }
Exemplo n.º 4
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());
        }
Exemplo n.º 5
0
        public ActionResult Index()
        {
            List <TamagotchiPet> allPets = TamagotchiPet.GetAll();

            return(View(allPets));
        }