Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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);
        }