aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/musichub/business
diff options
context:
space:
mode:
authorsaid belhadj <saidbelhadj0312@gmail.com>2021-06-27 16:07:27 +0200
committersaid belhadj <saidbelhadj0312@gmail.com>2021-06-27 16:07:27 +0200
commitf42590f675ec76e8b515aebd2ebf66430435b6bd (patch)
treedc72f8f8e18efc92c5ccabe1bb53593ba5376c0a /src/test/java/musichub/business
parent5dc7dea3ef53a385442c6bfd59054faa4b1d73d9 (diff)
Add unit test for Category and Language
Diffstat (limited to 'src/test/java/musichub/business')
-rw-r--r--src/test/java/musichub/business/CategoryTest.java25
-rw-r--r--src/test/java/musichub/business/LanguageTest.java23
2 files changed, 48 insertions, 0 deletions
diff --git a/src/test/java/musichub/business/CategoryTest.java b/src/test/java/musichub/business/CategoryTest.java
new file mode 100644
index 0000000..f1fef50
--- /dev/null
+++ b/src/test/java/musichub/business/CategoryTest.java
@@ -0,0 +1,25 @@
+package musichub.business;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+public class CategoryTest {
+
+ @Test
+ void testGetter() {
+
+ String t1 = "t1";
+ String a1 = "a1";
+ int l1 = 1;
+ String c1 = a1+" - "+t1;
+ String lan1 = "french";
+ String cat1 = "novel";
+ AudioBook s1 = new AudioBook(t1, a1, l1, c1, lan1, cat1);
+
+ assertEquals(s1.getCategory(), Category.NOVEL);
+ s1.setCategory("NOVEL");
+ assertEquals(s1.getCategory(), Category.NOVEL);
+ }
+}
diff --git a/src/test/java/musichub/business/LanguageTest.java b/src/test/java/musichub/business/LanguageTest.java
new file mode 100644
index 0000000..93e9d1c
--- /dev/null
+++ b/src/test/java/musichub/business/LanguageTest.java
@@ -0,0 +1,23 @@
+package musichub.business;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class LanguageTest {
+ @Test
+ void testGetter() {
+
+ String t1 = "t1";
+ String a1 = "a1";
+ int l1 = 1;
+ String c1 = a1+" - "+t1;
+ String lan1 = "FRENCH";
+ String cat1 = "novel";
+ AudioBook s1 = new AudioBook(t1, a1, l1, c1, lan1, cat1);
+ assertEquals(s1.getLanguage(), Language.FRENCH);
+ s1.setLanguage("french");
+ assertEquals(s1.getLanguage(), Language.FRENCH);
+ }
+
+}