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()); }
public void SetBuryGetIsBuried_GetsSetsBuried_True() { TamagotchiPet pet = new TamagotchiPet("Tan"); pet.Bury(); Assert.AreEqual(true, pet.IsBuried()); }
public void CheckExp_AddExpWhenPetIsAlive_Int() { TamagotchiPet pet = new TamagotchiPet("Bit"); pet.CheckExp(); Assert.AreEqual(1, pet.GetExp()); }
public void CheckForMax_ChecksIfStatIsHigherThanMax_Int() { TamagotchiPet pet = new TamagotchiPet("Tan"); pet.FoodReplenish(); Assert.AreEqual(100, pet.GetFood()); }
public void AddExpGetExp_AddsExpAndGetsExp_Int() { TamagotchiPet pet = new TamagotchiPet("Anton"); pet.AddExp(); pet.AddExp(); Assert.AreEqual(2, pet.GetExp()); }
public void DisplayPetData_ReturnsCorrectView_True() { TamagotchiPet pet = new TamagotchiPet("Gandalf"); HomeController controller = new HomeController(); ActionResult DisplayPetData = controller.DisplayPetData(1); Assert.IsInstanceOfType(DisplayPetData, typeof(ViewResult)); }
public void CheckExp_DoesNotAddExpWhenPetIsDead_Int() { TamagotchiPet pet = new TamagotchiPet("Bit"); pet.SetIsDead(true); pet.CheckExp(); Assert.AreEqual(0, pet.GetExp()); }
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>)); }
public void BuryPet_ReturnsCorrectView_True() { TamagotchiPet pet = new TamagotchiPet("Balrog"); HomeController controller = new HomeController(); ActionResult BuryPet = controller.BuryPet(1); Assert.IsInstanceOfType(BuryPet, typeof(ViewResult)); }
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>)); }
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 void SetGetDecayValue_SetsGetsDecayValue_Int() { TamagotchiPet pet = new TamagotchiPet("Anton"); pet.SetDecayValue(); int randNum = pet.GetDecayValue(); Assert.AreEqual(randNum, pet.GetDecayValue()); }
public ActionResult BuryPet(int id) { TamagotchiPet pet = TamagotchiPet.Find(id); pet.Bury(); List <TamagotchiPet> allPets = TamagotchiPet.GetAll(); return(View("DisplayPetData", allPets)); }
public ActionResult Decay() { List <TamagotchiPet> allPets = TamagotchiPet.GetAll(); foreach (TamagotchiPet pet in allPets) { pet.RunLifeCycle(); } return(View("DisplayPetData", allPets)); }
public ActionResult DisplayPetData(int id) { TamagotchiPet pet = TamagotchiPet.Find(id); List <TamagotchiPet> singlePetList = new List <TamagotchiPet>() { pet }; return(View(singlePetList)); }
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()); }
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()); }
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()); }
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()); }
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()); }
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() })); }