示例#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"));
        }
示例#2
0
        public void FindSongs_FromSpotify()
        {
            //Arrange
            string            name              = "Sail";
            string            artist            = "AWOLNATION";
            string            expectedResponse  = "This calls Spotify API to search for song Sail from artist AWOLNATION";
            SpotifyApiService spotifyApiService = new SpotifyApiService();
            IBEApiService     adapter           = new SpotifyApiServiceAdapter(spotifyApiService);
            BEApplication     app = new BEApplication(adapter);

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

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