示例#1
0
        public void C_Update()
        {
            Project.Data.Repository repo = new Project.Data.Repository(db);
            int songid = 0;

            foreach (var i in repo.GetSongs())
            {
                songid = i.Id;
            }
            Project.Domain.Song songTest = new Project.Domain.Song()
            {
                Id          = songid,
                Title       = "Encore",
                Artist      = "Linkin Park",
                Genre       = "Rock",
                Size        = "3.45",
                Length      = "3.7",
                ReleaseDate = "1993",
                FilePath    = "audio/file"
            };


            repo.UpdateSong(songTest);

            Assert.Pass();
        }
示例#2
0
        public void B_Read_3()
        {
            int songId = 0;

            Project.Data.Repository repo = new Project.Data.Repository(db);
            foreach (var i in repo.GetSongs())
            {
                songId = i.Id;
            }
            Project.Domain.Song song = repo.GetSongByTitle("Encore", "Linkin Park");
            Assert.AreEqual(song.Id, songId);
        }
示例#3
0
        public void D_Delete()
        {
            int songId = 0;

            Project.Data.Repository repo = new Project.Data.Repository(db);
            foreach (var i in repo.GetSongs())
            {
                songId = i.Id;
            }
            repo.DeleteSong(songId);
            Assert.Pass();
        }
示例#4
0
        public void B_Read_2()
        {
            int songId = 0;

            Project.Data.Repository repo = new Project.Data.Repository(db);
            foreach (var i in repo.GetSongs())
            {
                songId = i.Id;
            }
            Project.Domain.Song song = repo.GetSongById(songId);

            string expectedValue = "Encore";
            string actualValue   = song.Title;

            Assert.AreEqual(expectedValue, actualValue);
            //Assert.Pass();
        }
示例#5
0
 public void B_Read_1()
 {
     Project.Data.Repository repo = new Project.Data.Repository(db);
     repo.GetSongs();
     Assert.Pass();
 }