1 /***
2 * Ambient - A music player for the Android platform
3 Copyright (C) 2007 Martin Vysny
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 package sk.baka.ambient.library;
20
21 import java.util.Arrays;
22 import java.util.List;
23
24 import junit.framework.TestCase;
25 import sk.baka.ambient.commons.MiscUtils;
26
27 /***
28 * Tests {@link GenreCacheTest}.
29 *
30 * @author Martin Vysny
31 */
32 public final class GenreCacheTest extends TestCase {
33 /***
34 *
35 */
36 public void testSplitGenres() {
37 List<String> tags = MiscUtils.iterableToList(GenreCache
38 .splitGenres(" polka "));
39 assertEquals(Arrays.asList("polka"), tags);
40 tags = MiscUtils
41 .iterableToList(GenreCache.splitGenres(" drum n base"));
42 assertEquals(Arrays.asList("drum n base"), tags);
43 tags = MiscUtils.iterableToList(GenreCache
44 .splitGenres("drum n base, jazz"));
45 assertEquals(Arrays.asList("drum n base", "jazz"), tags);
46 tags = MiscUtils.iterableToList(GenreCache
47 .splitGenres("techno , ambient"));
48 assertEquals(Arrays.asList("techno", "ambient"), tags);
49 }
50 }