Example #1
0
        public void TestAlbumRepo_Update()
        {
            var album = albumRepository.GetAll()[0];

            album.Auteur = "NomAuteurTest";
            albumRepository.Save(album);
            TestRepository.ClearSession();
            album = albumRepository.GetAll().Where(l => l.Nom == "Le Nom de Edward").ToList()[0];
            Assert.AreEqual("NomAuteurTest", album.Auteur);
        }
Example #2
0
        public void TestAlbumRepo_SaveExisting()
        {
            var album = _albumRepository.GetAll()[0];

            album.Couverture = "";
            _albumRepository.Save(album);
            TestRepository.ClearSession();
            album = _albumRepository.GetAll().Where(a => a.Nom ==
                                                    "Tintin au Tibet").ToList()[0];
            Assert.AreEqual("", album.Couverture);
        }
        public void TestActionRepo_SaveExisting()
        {
            Action action = _actionRepository.GetAll()[6];

            action.Nom = "Achat";
            _actionRepository.SaveAction(action);
            TestRepository.ClearSession();
            action = _actionRepository.GetAll().Where(a => a.idAction ==
                                                      7).ToList()[0];
            Assert.AreEqual("Achat", action.Nom);
        }
Example #4
0
        public void TestPersonneRepo_SaveExisting()
        {
            var personne = _personneRepository.GetAll()[3];

            personne.Nom = "paulochon";
            _personneRepository.Save(personne);
            TestRepository.ClearSession();
            personne = _personneRepository.GetAll().Where(p => p.Nom ==
                                                          "paulochon").ToList()[0];
            Assert.AreEqual("paulochon", personne.Nom);
        }
Example #5
0
        public void TestAlbumRepo_SaveNew()
        {
            Album _alb = new Album("A l'aube d'une grande aventure", "One Piece", "", "Manga", "Aventure", "Shueisha", "Eiichiro Oda");

            _albumRepository.Save(_alb);
            TestRepository.ClearSession();
            // Recherche des albums portant le même titre
            var albums = _albumRepository.GetAll().Where(a => a.Nom ==
                                                         "A l'aube d'une grande aventure").ToList();

            // 1 seul album correspondant dans le jeu de données de test
            Assert.AreEqual(1, albums.Count);
        }
Example #6
0
        public void TestPersonneRepo_SaveNew()
        {
            Personne personne = new Utilisateur("paul", "User", "pvulo", "julo");

            _personneRepository.Save(personne);
            TestRepository.ClearSession();
            // Recherche des personnes portant le même titre
            var personnes = _personneRepository.GetAll().Where(p => p.Nom ==
                                                               "paul").ToList();

            // 1 seule personne correspondant dans le jeu de données de test
            Assert.AreEqual(1, personnes.Count);
        }
Example #7
0
        public void TestAlbumRepo_SaveNew()
        {
            var album = new Album("Cover4", "Nom4", "Serie4", "Auteur4", "comic", "polar", "Editeur4");

            albumRepository.Save(album);

            TestRepository.ClearSession();
            // Recherche des livres portant le même titre
            var albums = albumRepository.GetAll().Where(l => l.Nom ==
                                                        "Nom4").ToList();

            // 1 seul album correspondant dans le jeu de données de test
            Assert.AreEqual(1, albums.Count);
            Album nouvelAlbum = albums[0];

            Assert.AreEqual("Nom4", nouvelAlbum.Nom);
            Assert.AreEqual("Auteur4", nouvelAlbum.Auteur);
        }