public void FindAlbum_ArtistHrefAndAlbumNameIsNotNull_CallsLookupServiceArtistLookupWithArtistHref() { var lookupServiceFake = A.Fake <ILookupService>(); var spotifyAlbumService = new SpotifyAlbumService(lookupServiceFake); var album = spotifyAlbumService.FindAlbum("jkl", "abc", "def"); A.CallTo(() => lookupServiceFake.ArtistLookup("jkl")).MustHaveHappened(Repeated.Exactly.Once); }
public void FindAlbum_ArtistLookupReturnsNull_ReturnsNull() { var lookupServiceFake = A.Fake <ILookupService>(); A.CallTo(() => lookupServiceFake.ArtistLookup(A <string> .Ignored)).Returns(null); var spotifyAlbumService = new SpotifyAlbumService(lookupServiceFake); var album = spotifyAlbumService.FindAlbum("jkl", "abc", "def"); Assert.That(album, Is.Null); }
public void FindAlbum_ArtistLookupArtistAlbumsIsEmpty_ReturnsNull() { var lookupServiceFake = A.Fake <ILookupService>(); A.CallTo(() => lookupServiceFake.ArtistLookup(A <string> .Ignored)).Returns(new ArtistInfo { Artist = new SpotiKat.Spotify.Entities.Lookup.Artist { Albums = new List <AlbumInfo>() } }); var spotifyAlbumService = new SpotifyAlbumService(lookupServiceFake); var album = spotifyAlbumService.FindAlbum("jkl", "abc", "def"); Assert.That(album, Is.Null); }
public void FindAlbum_ArtistLookupMatchingAlbumNameAndNullTerritory_ReturnsAlbum() { var lookupServiceFake = A.Fake <ILookupService>(); A.CallTo(() => lookupServiceFake.ArtistLookup(A <string> .Ignored)).Returns(new ArtistInfo { Artist = new SpotiKat.Spotify.Entities.Lookup.Artist { Albums = new List <AlbumInfo> { new AlbumInfo { Album = new SpotiKat.Spotify.Entities.Lookup.Album { Name = "abc", Availability = new Availability { TerritoriesAsString = "def uio" } } } } } }); var spotifyAlbumService = new SpotifyAlbumService(lookupServiceFake); var album = spotifyAlbumService.FindAlbum("jkl", "abc", null); Assert.That(album, Is.Not.Null); }
public void FindAlbum_AlbumNameIsNull_ThrowsArgumentNullException() { var spotifyAlbumService = new SpotifyAlbumService(A.Fake <ILookupService>()); Assert.Throws <ArgumentNullException>(() => spotifyAlbumService.FindAlbum("jkl", null, "def")); }
public void FindAlbum_ArtistHrefIsNull_ThrowsArgumentNullException() { var spotifyAlbumService = new SpotifyAlbumService(A.Fake <ILookupService>()); Assert.Throws <ArgumentNullException>(() => spotifyAlbumService.FindAlbum(null, "abc", "def")); }