public void DeleteConfirmed() { ITamagotchiRepository tamagotchiRepository = new DummyTamagotchiRepository(); TamagotchisController tamagotchisController = new TamagotchisController(tamagotchiRepository); TamagotchiModel subject = tamagotchiRepository.Get(2); tamagotchisController.DeleteConfirmed(2); Assert.IsTrue(!tamagotchiRepository.GetAll().Contains(subject)); }
public void EditPost() { ITamagotchiRepository tamagotchiRepository = new DummyTamagotchiRepository(); TamagotchisController tamagotchisController = new TamagotchisController(tamagotchiRepository); TamagotchiModel tam1 = tamagotchiRepository.Get(1); tam1.Level = 85; tam1.Leeftijd = 72; tamagotchisController.Edit(tam1); Assert.AreEqual(tam1, tamagotchiRepository.Get(1)); }
public void CreatePost() { ITamagotchiRepository tamagotchiRepository = new DummyTamagotchiRepository(); TamagotchisController tamagotchisController = new TamagotchisController(tamagotchiRepository); // Act TamagotchiModel newtamagotchi = new TamagotchiModel() { Naam = "testTamagochi" }; RedirectToRouteResult result = tamagotchisController.Create(newtamagotchi) as RedirectToRouteResult; Assert.IsTrue(tamagotchiRepository.GetAll().Contains(newtamagotchi)); Assert.IsNotNull(result); }