private IHttpActionResult RetrieveAlbumInfo(string artist, string album) { var albumInfo = AlbumInfo.FromRepositoryObject(repository.FindAlbumInfo(artist, album)); if (!string.IsNullOrWhiteSpace(albumInfo.Name)) { return(Ok(albumInfo)); } return(NotFound()); }
public void FromRepositoryObject() { var lastfmAlbumInfo = TestAlbumInfo.Create(); var result = AlbumInfo.FromRepositoryObject(lastfmAlbumInfo); Assert.That(result.Name, Is.EqualTo(lastfmAlbumInfo.Name)); Assert.That(result.Artist, Is.EqualTo(lastfmAlbumInfo.Artist)); Assert.That(result.ReleaseDate, Is.EqualTo(lastfmAlbumInfo.ReleaseDate)); Assert.That(result.WikiSummary, Is.EqualTo(lastfmAlbumInfo.WikiSummary)); }