aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
+ }
+}
9 19:07:48 +0200'>2025-07-09tofu: update bpg/proxmox to 0.79.0clyhtsuriva1-1/+1 2025-06-22ansible: set apt lock_timeout to 3minclyhtsuriva3-2/+4 2025-06-22tofu: update bpg/proxmox to 0.78.2clyhtsuriva1-1/+1 2025-05-24tofu: update bpg/proxmox to 0.78.0 (tested)clyhtsuriva2-2/+3 2025-05-01tofu: update bpg/proxmox to 0.77.0 (tested)clyhtsuriva1-1/+1 2025-04-22tofu: update bpg/proxmox to 0.76.0 (tested)clyhtsuriva1-1/+1 2025-04-15tofu: update bpg/proxmox to 0.75.0 (tested)clyhtsuriva1-1/+1 2025-04-04ansible: remove docker git repo cloning taskclyhtsuriva2-46/+0 2025-04-04ansible: deploy gitea using ansible (w.i.p.)clyhtsuriva4-0/+58