Exemplo n.º 1
0
        public void select_ReturnsArtistInDb()
        {
            //Arrange
            ArtistDao testDao        = new ArtistDao(mockDb);
            Artist    expectedArtist = new Artist(1, "Fun.");

            //Act
            Artist actualArtist = testDao.select(expectedArtist.ArtistId);

            //Assert
            Assert.AreEqual(expectedArtist.ArtistId, actualArtist.ArtistId);
            Assert.AreEqual(expectedArtist.Name, actualArtist.Name);
        }
Exemplo n.º 2
0
        public void update_UpdatesArtistInDb()
        {
            //Arrange
            ArtistDao testDao      = new ArtistDao(mockDb);
            Artist    updateArtist = new Artist(1, "Not Fun.");

            //Act
            testDao.update(updateArtist);

            //Assert
            IEnumerable <Artist> artists = testDao.select();

            Assert.IsTrue(artists.ToList().Contains(updateArtist));
        }
Exemplo n.º 3
0
        public void delete_RemovesArtistFromDb()
        {
            //Arrange
            ArtistDao testDao      = new ArtistDao(mockDb);
            Artist    deleteArtist = new Artist(1, "Fun.");

            //Act
            testDao.delete(deleteArtist);

            //Assert
            IEnumerable <Artist> artists = testDao.select();

            Assert.IsTrue(!artists.ToList().Contains(deleteArtist));
        }
Exemplo n.º 4
0
        public void insert_InsertsArtistInDb()
        {
            //Arrange
            ArtistDao testDao   = new ArtistDao(mockDb);
            Artist    newArtist = new Artist(3, "Prince");

            //Act
            testDao.insert(newArtist);

            //Assert
            IEnumerable <Artist> artists = testDao.select();

            Assert.IsTrue(artists.ToList().Contains(newArtist));
        }