public void Delete() { TamagotchisController tamagotchisController = new TamagotchisController(new DummyTamagotchiRepository()); // Act ViewResult result = tamagotchisController.Edit(1) as ViewResult; // Assert Assert.IsNotNull(result); }
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 TamagotchisControllerIndexNotNull() { // Arrange var controller = new TamagotchisController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.IsNotNull(result); }
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); }