Example #1
0
        static void Main(string[] args)
        {
            SpotifyApiService spotifyApiService = new SpotifyApiService();
            IBEApiService     adapter           = new SpotifyApiServiceAdapter(spotifyApiService);
            BEApplication     app = new BEApplication(adapter);

            Console.WriteLine(app.FindSongs("Sail", "AWOLNATION"));

            YoutubeApiService youtubeApiService = new YoutubeApiService();

            adapter = new YoutubeApiServiceAdapter(youtubeApiService);
            app     = new BEApplication(adapter);
            Console.WriteLine(app.FindSongs("Burn It Down", "Linkin Park"));
        }
Example #2
0
        public void FindSongs_FromYoutube()
        {
            //Arrange
            string            name              = "Sail";
            string            artist            = "AWOLNATION";
            string            expectedResponse  = "This calls Youtube API to search for song Sail from artist AWOLNATION";
            YoutubeApiService youtubeApiService = new YoutubeApiService();
            IBEApiService     adapter           = new YoutubeApiServiceAdapter(youtubeApiService);
            BEApplication     app = new BEApplication(adapter);

            //Act
            string response = app.FindSongs(name, artist);

            //Assert
            Assert.AreEqual(response, expectedResponse);
        }