aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/java/musichub/business/SongTest.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/test/java/musichub/business/SongTest.java b/src/test/java/musichub/business/SongTest.java
new file mode 100644
index 0000000..b25b6d2
--- /dev/null
+++ b/src/test/java/musichub/business/SongTest.java
@@ -0,0 +1,46 @@
+package musichub.business;
+
+import musichub.util.XMLHandler;
+import org.junit.jupiter.api.Test;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+public class SongTest {
+ String title = "Side To Side";
+ String artist = "Ariana Grande";
+ int length = 186;
+ String uid = "66d277ca-cbc4-471c-a07e-082363375bcc";
+ String content = "Song/Side_To_Side.wav";
+ String genre = "rock";
+
+ @Test
+ void testSongClasses() {
+ Song song_uuid = new Song(title, artist, length, uid, content, genre);
+ Song song = new Song(title, artist, length, content, genre);
+
+ }
+
+ @Test
+ void testSongXml() {
+ final String DIR = System.getProperty("user.dir");
+ final String ELEMENTS_FILE_PATH = DIR + "/files/elements.xml";
+ final XMLHandler xmlHandler = new XMLHandler();
+ NodeList audioelementsNodes = xmlHandler.parseXMLFile(ELEMENTS_FILE_PATH);
+ Element audioElement = (Element) audioelementsNodes.item(1);
+ Song song_xml = new Song(audioElement);
+ }
+
+ @Test
+ void testGetGenre() {
+ assertEquals(new Song(title, artist, length, content, genre).getGenre(), "rock");
+ assertNotEquals(new Song(title, artist, length, content, genre).getGenre(), "pop");
+ }
+
+ @Test
+ void testSetGenre() {
+ // Not Implemented Yet
+ }
+}
td>3-16/+102 2020-12-23Implementing AlbumClyhtsuriva3-17/+155 2020-12-22SimplifyingClyhtsuriva2-129/+81 2020-12-19Adding AudioBooksClyhtsuriva7-48/+225 2020-12-11(De)Serialization of the songsClyhtsuriva2-42/+63 2020-12-11Getting serialization working with a songClyhtsuriva3-7/+36 2020-12-11adding Serialization interface and methodsClyhtsuriva6-59/+63 2020-12-07Big updateMasfehico6-16/+99 2020-12-07cleaning and adding stuff in playlistMasfehico3-2/+20 2020-12-07Updating song and audiobook accordingly to the last commitMasfehico2-8/+8 2020-12-07Adding the enum classesMasfehico3-0/+9 2020-12-07Updating song, audiobook and musical elements's sets and getsMasfehico3-5/+23 2020-12-07Finishing MusicalElement.javaMasfehico1-6/+11 2020-11-23Cleaning upMasfehico2-30/+0 2020-11-23Deleting the CSVSMasfehico5-3669/+0 2020-11-23Minor testing changesMasfehico7-43/+63 2020-11-23Musical elements updated and jMusicHub basic creationMasfehico2-0/+0 2020-11-23Musical elements updated and jMusicHub basic creationMasfehico4-3/+74 2020-11-21README.md updatedMasfehico1-3/+1 2020-11-19Started Song and MusicalElementMasfehico5-0/+190 2020-11-18Added CSVsMasfehico9-102/+3756 2020-11-18Firs filesMasfehico8-0/+103 2020-11-17LICENSE updatedMasfehico1-68/+81