public void ApiCaller_FindLyrics_NullArtisttWeAreTheChampions_ReturnsCorrectData() { ApiCaller caller = new ApiCaller(); string result = caller.FindLyricsByArtistAndTitle("", testSongTitle); Assert.IsNull(result); }
public void ApiCaller_FindLyrics_nullArtist_nullTitle_ReturnsCorrectData() { ApiCaller caller = new ApiCaller(); string result = caller.FindLyricsByArtistAndTitle(null, null); Assert.IsNull(result); }
public void ApiCaller_FindLyrics_IncorrectArtistWeAreTheChampions_ReturnsCorrectData() { ApiCaller caller = new ApiCaller(); string result = caller.FindLyricsByArtistAndTitle(testArtistName, testSongTitle); Assert.IsNotNull(result); Assert.IsTrue(result.Contains("champions")); }
public void ApiCaller_FindArtist_Queen_ReturnsExpectedData() { List <int> totalWordCount = new List <int>(); ApiCaller apiCaller = new ApiCaller(); LyricFormatter lyricFormatter = new LyricFormatter(); Guid artistId = apiCaller.FindArtist("queen"); List <string> songTitles = apiCaller.FindSongTitlesByArtist(artistId); foreach (string songTitle in songTitles) { //Only add item to word count if lyrics found. string lyrics = apiCaller.FindLyricsByArtistAndTitle(songTitle); if (!string.IsNullOrWhiteSpace(lyrics)) { totalWordCount.Add(lyricFormatter.GetTotalNumberOfWords(lyrics)); } } //RESULT! Math.Round(totalWordCount.Average()); var a = totalWordCount; }