Ejemplo n.º 1
0
        public void ApiCaller_FindArtist_Queen_ReturnsCorrectData()
        {
            ApiCaller caller = new ApiCaller();
            Guid      result = caller.FindArtist(testArtistName);

            Assert.IsNotNull(result);
            Assert.AreNotEqual(Guid.Empty, result);
        }
Ejemplo n.º 2
0
        public void ApiCaller_FindArtist_WhiteSpace_ReturnsCorrectData()
        {
            ApiCaller caller = new ApiCaller();
            Guid      result = caller.FindArtist(" ");

            Assert.IsNotNull(result);
            Assert.AreEqual(Guid.Empty, result);
        }
Ejemplo n.º 3
0
        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;
        }