コード例 #1
0
        public async Task UpdateMusicPlaylistAsyncShouldUpdateMusicPlaylist()
        {
            using (var context = new MusicDBContext(options))
            {
                IMusicRepoDB  _repo             = new MusicRepoDB(context);
                MusicPlaylist testMusicPlaylist = new MusicPlaylist();
                testMusicPlaylist.Id         = 4;
                testMusicPlaylist.PlayListId = 2;
                testMusicPlaylist.MusicId    = 1;
                var newMusicPlaylist = await _repo.AddMusicPlaylistAsync(testMusicPlaylist);

                testMusicPlaylist.PlayListId = 1;
                var updateMusicPlaylist = await _repo.UpdateMusicPlaylistAsync(testMusicPlaylist);

                Assert.Equal(1, updateMusicPlaylist.PlayListId);
            }
        }