コード例 #1
0
        public void BuildArtistSearchUrl_QueryIsNotNull_ReturnsUrl()
        {
            var spotifyConfigurationFake = A.Fake <ISpotifyConfiguration>();

            A.CallTo(() => spotifyConfigurationFake.SearchServiceUrlFormat).Returns("http://ws.spotify.com/search/1/{0}.json?q={1}&page={2}");

            var urlBuilder = new UrlBuilder(spotifyConfigurationFake);

            var url = urlBuilder.BuildArtistSearchUrl("abc", 1);

            Assert.That(url, Is.EqualTo("http://ws.spotify.com/search/1/artist.json?q=abc&page=1"));
        }
コード例 #2
0
        public void BuildArtistSearchUrl_QueryIsNull_ThrowsArgumentNullException()
        {
            var urlBuilder = new UrlBuilder(A.Fake <ISpotifyConfiguration>());

            Assert.Throws <ArgumentNullException>(() => urlBuilder.BuildArtistSearchUrl(null, 1));
        }