예제 #1
0
        public async Task GetUploadedMusicByIDAsyncShouldReturnUploadedMusic()
        {
            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);

                var foundUploadedMusic = await _repo.GetUploadedMusicByIDAsync(4);

                Assert.NotNull(foundUploadedMusic);
                Assert.Equal(4, foundUploadedMusic.Id);
            }
        }