Beispiel #1
0
        public async Task UpdateUploadedMusicAsyncShouldUpdateUploadedMusic()
        {
            using (var context = new MusicDBContext(options))
            {
                IMusicRepoDB _repo           = new MusicRepoDB(context);
                UploadMusic  testUploadMusic = new UploadMusic();
                testUploadMusic.Id            = 4;
                testUploadMusic.UserId        = 1;
                testUploadMusic.MusicFilePath = "cool_song";
                testUploadMusic.Name          = "Jumping Jacks";
                testUploadMusic.UploadDate    = DateTime.Parse("2021-03-15 18:17:00");
                testUploadMusic.Likes         = 3409;
                testUploadMusic.Plays         = 9084;
                var newUploadMusic = await _repo.AddUploadedMusicAsync(testUploadMusic);

                testUploadMusic.Name = "Jumping Jax";
                var updateUploadMusic = await _repo.UpdateUploadedMusicAsync(testUploadMusic);

                Assert.Equal("Jumping Jax", updateUploadMusic.Name);
            }
        }