Пример #1
0
        public async Task LyricsGetAsync(string artist, string title, params string[] keywords)
        {
            using (var service = new LyricsService(new LyricsOptions()))
            {
                var lyrics = await service.GetLyricsAsync(artist, title);

                foreach (var keyword in keywords)
                {
                    Assert.Contains(keyword, lyrics, StringComparison.InvariantCultureIgnoreCase);
                }
            }
        }
Пример #2
0
        public async Task LyricServiceTest()
        {
            var artistName = "Queen";
            var songTitle  = "Radio Gaga";

            var client = new RestClient("https://api.lyrics.ovh");

            var musicBrainzService = new LyricsService(client, new NullLogger <LyricsService>());

            string lyrics = await musicBrainzService.GetLyricsAsync(artistName, songTitle);

            Assert.True(!string.IsNullOrEmpty(lyrics));
            Assert.StartsWith("I'd sit alone and watch your light", lyrics);
        }