-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathStudentTest.java
More file actions
80 lines (61 loc) · 2.21 KB
/
StudentTest.java
File metadata and controls
80 lines (61 loc) · 2.21 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
package io.zipcoder;
import org.junit.Assert;
import org.junit.Test;
import java.sql.Array;
import java.sql.SQLOutput;
import java.util.*;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
public class StudentTest {
@Test
public void TestStudentConstructor(){
String expectedName = "Bilbo";
String expectedLastName = "Baggins";
Double [] testScores = {10.,15.};
Student someStudent = new Student("Bilbo", "Baggins", testScores);
String actualName = someStudent.getFirstName();
String actualLastName = someStudent.getLastName();
Assert.assertEquals(expectedName,actualName);
Assert.assertEquals(expectedLastName,actualLastName);
}
@Test
public void TestStudentName(){
String expectedName = "Bilbo";
String expectedLastName = "Baggins";
Double [] testScores = {10.,15.};
Student someStudent = new Student(null, null, testScores);
someStudent.setFirstName("Bilbo");
someStudent.setLastName("Baggins");
String actualName = someStudent.getFirstName();
String actualLastName = someStudent.getLastName();
Assert.assertEquals(expectedName,actualName);
Assert.assertEquals(expectedLastName,actualLastName);
}
@Test
public void TestGetExamScore() {
String firstName = "Leon";
String lastName = "Hunter";
Double[] examScores ={1.3,1.2};
Student student = new Student(firstName, lastName, examScores);
String output = student.getExamScores();
System.out.println(output);
}
@Test
public void setExamScores() {
String firstName = "Leon";
String lastName = "Hunter";
Double[] examScores = {1.3,99.};
Student student = new Student(firstName, lastName, examScores);
String output = student.getExamScores();
System.out.println(output);
}
@Test
public void testToString() {
String firstName = "Leon";
String lastName = "Hunter";
Double[] examScores = {1.3,99.};
Student student = new Student(firstName, lastName, examScores);
System.out.println(student.toString());
}
}