public void SimpleWithTrackNumber() { FuzzyMatcher f = new FuzzyMatcher(); var filenames = new[] { "/home/ngeor/iTunes/Artist/Album/01 Track.mp3".NormalizePath() }; var result = f.Find("/home/ngeor/iTunes/".NormalizePath(), filenames, "Artist - Track"); CollectionAssert.AreEqual(filenames, result); }
public void MatchStartsWith() { FuzzyMatcher f = new FuzzyMatcher(); var filenames = new[] { "/home/ngeor/iTunes/Compilations/A Tribute To Abba/03 Gimme! Gimme! Gimme! (A Man After Midnight).mp3".NormalizePath() }; var result = f.Find("/home/ngeor/iTunes/".NormalizePath(), filenames, "Compilations - Gimme, Gimme, Gimme"); CollectionAssert.AreEqual(filenames, result); }
public void MatchIsCaseInsensitive() { FuzzyMatcher f = new FuzzyMatcher(); var filenames = new[] { "/home/ngeor/iTunes/ARTIST/Album/01 TRACK.mp3".NormalizePath() }; var result = f.Find("/home/ngeor/iTunes/".NormalizePath(), filenames, "Artist - Track"); CollectionAssert.AreEqual(filenames, result); }
public void ShouldMatchAllArtistsIfOnlyTrackIsGiven() { FuzzyMatcher f = new FuzzyMatcher(); var filenames = new[] { "/home/ngeor/iTunes/Artist1/Album3/01-2 Track.mp3".NormalizePath(), "/home/ngeor/iTunes/Artist2/Album4/01-2 Track.mp3".NormalizePath() }; var result = f.Find("/home/ngeor/iTunes/".NormalizePath(), filenames, "Track"); CollectionAssert.AreEqual(filenames, result); }