public MusicLibrary Filter(MusicLibrary original, MetalArchivesRequest request)
 {
     // looks like without the FindAll below, MA is returning any artists whose names even slightly match our request
     // ensuring that the discovered artistname starts the same as the desired artistname helps prevent this
     return new MusicLibrary(original.Collection
         .FindAll(x => x.ArtistData.ArtistName.StartsWith(request.ArtistName))
         .FindAll(x => x.ReleaseData.IsFullLength));
 }
Esempio n. 2
0
        public void GivenAnArtistNameContainingSpaces_WhenCreatingRequest_ThenArtistNameIsWrappedInQuotes()
        {
            var request = new MetalArchivesRequest(new ArtistData("a test artist name"));

            var expected = "\"a test artist name\"";
            var actual   = request.ArtistName;

            Assert.AreEqual(expected, actual);
        }