public async Task AdminSongService_DeleteAsync_ShouldReturnFalseWhenSongDoesNotExist() { //Arrenge var db = this.GetDatabase(); await this.PopulateDbAsync(db); var adminSongService = new AdminSongService(db); var song = await db.Songs.FindAsync(SongId + 10); //Act var result = await adminSongService.DeleteAsync(SongId + 10); //Assert result.Should().Be(false); song.Should().BeNull(); }
public async Task AdminSongService_DeleteAsync_ShouldDeleteAndSaveCorrectSong() { //Arrenge var db = this.GetDatabase(); await this.PopulateDbAsync(db); var adminSongService = new AdminSongService(db); var song = await db.Songs.FindAsync(SongId); //Act var result = await adminSongService.DeleteAsync(SongId); //Assert result.Should().Be(true); db.Songs.Should().NotContain(song); song.Should().NotBeNull(); }