-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMusicModelTest.java
More file actions
116 lines (102 loc) · 2.25 KB
/
MusicModelTest.java
File metadata and controls
116 lines (102 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/*
* Test the MusicModel class
*/
public class MusicModelTest
{
@Test
public void testGetInfo1()
{
MusicModel m = new MusicModel();
assertEquals(true, m.getInfo("michael jackson"));
}
@Test
public void testGetInfo2()
{
MusicModel m = new MusicModel();
assertEquals(false, m.getInfo("bleh"));
}
@Test
public void testGetName()
{
MusicModel m = new MusicModel();
if (m.getInfo("michael jackson")) {
assertEquals("Michael Jackson", m.getName());
}
}
@Test
public void testGetCountry()
{
MusicModel m = new MusicModel();
if (m.getInfo("michael jackson")) {
assertEquals("Indiana, USA", m.getCountry());
}
}
@Test
public void testGetBornYear1()
{
MusicModel m = new MusicModel();
if (m.getInfo("michael jackson")) {
assertEquals("1958", m.getBornYear());
}
}
@Test
public void testGetDiedYear1()
{
MusicModel m = new MusicModel();
if (m.getInfo("michael jackson")) {
assertEquals("2009", m.getDiedYear());
}
}
@Test
public void testGetBornYear2()
{
MusicModel m = new MusicModel();
if (m.getInfo("the beatles")) {
assertEquals("1957", m.getBornYear());
}
}
@Test
public void testGetDiedYear2()
{
MusicModel m = new MusicModel();
if (m.getInfo("the beatles")) {
assertEquals("1970", m.getDiedYear());
}
}
@Test
public void testGetGenre()
{
MusicModel m = new MusicModel();
if (m.getInfo("michael jackson")) {
assertEquals("Pop", m.getGenre());
}
}
@Test
public void testGetWebsite()
{
MusicModel m = new MusicModel();
if (m.getInfo("michael jackson")) {
assertEquals("www.michaeljackson.com", m.getWebsite());
}
}
@Test
public void testGetLabel()
{
MusicModel m = new MusicModel();
if (m.getInfo("michael jackson")) {
assertEquals("Epic", m.getLabel());
}
}
@Test
public void testGetBio()
{
MusicModel m = new MusicModel();
if (m.getInfo("billie eilish")) {
assertEquals("\"Billie Eilish\" (born December 18, 2001)", m.getBio().substring(0, 41));
}
}
}