Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package oosd2;
- import org.junit.After;
- import org.junit.AfterClass;
- import org.junit.Before;
- import org.junit.BeforeClass;
- import org.junit.Test;
- import static org.junit.Assert.*;
- /**
- *
- * @author Marken Tuan Nguyen
- */
- public class StudentTest {
- public StudentTest() {
- }
- @BeforeClass
- public static void setUpClass() {
- }
- @AfterClass
- public static void tearDownClass() {
- }
- @Before
- public void setUp() {
- }
- @After
- public void tearDown() {
- }
- /**
- * Test of getStudentID method, of class Student.
- */
- @Test
- public void testGetStudentID() {
- System.out.println("getStudentID");
- int studentID = 100;
- Student instance = new Student(studentID,"");
- int result = instance.getStudentID();
- assertEquals(studentID, result);
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of setStudentID method, of class Student.
- */
- @Test
- public void testSetStudentID() {
- System.out.println("setStudentID");
- Student instance = new Student(99,"");
- System.out.println("\tBefore set: "+instance.getStudentID());
- instance.setStudentID(100);
- System.out.println("\tAfter set: "+instance.getStudentID());
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of getStudentName method, of class Student.
- */
- @Test
- public void testGetStudentName() {
- System.out.println("getStudentName");
- Student instance = new Student(123,"Marken");
- String studentName = "Marken";
- String result = instance.getStudentName();
- assertEquals(studentName, result);
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of setStudentName method, of class Student.
- */
- @Test
- public void testSetStudentName() {
- System.out.println("setStudentName");
- Student instance = new Student(123,"Marken");
- System.out.println("\tBefore set: "+instance.getStudentName());
- instance.setStudentName("Brendan");
- System.out.println("\tAfter set: "+instance.getStudentName());
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of getStudentPhone method, of class Student.
- */
- @Test
- public void testGetStudentPhone() {
- System.out.println("getStudentPhone");
- Student instance = new Student();
- int expResult = 0;
- int result = instance.getStudentPhone();
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of setStudentPhone method, of class Student.
- */
- @Test
- public void testSetStudentPhone() {
- System.out.println("setStudentPhone");
- Student instance = new Student();
- System.out.println("\tBefore set: "+instance.getStudentPhone());
- instance.setStudentPhone(123456789);
- System.out.println("\tAfter set: "+instance.getStudentPhone());
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of getStudentEmail method, of class Student.
- */
- @Test
- public void testGetStudentEmail() {
- System.out.println("getStudentEmail");
- Student instance = new Student();
- String expResult = "marken@manager.com";
- instance.setStudentEmail("marken@manager.com");
- String result = instance.getStudentEmail();
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of setStudentEmail method, of class Student.
- */
- @Test
- public void testSetStudentEmail() {
- System.out.println("setStudentEmail");
- Student instance = new Student();
- System.out.println("\tBefore Set: " + instance.getStudentEmail());
- instance.setStudentEmail("marken@manager.com");
- System.out.println("\tAfter Set: " + instance.getStudentEmail());
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of getStudentBirth method, of class Student.
- */
- @Test
- public void testGetStudentBirth() {
- System.out.println("getStudentBirth");
- Student instance = new Student();
- String expResult = "28/08/1998";
- instance.setStudentBirth("28/08/1998");
- String result = instance.getStudentBirth();
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of setStudentBirth method, of class Student.
- */
- @Test
- public void testSetStudentBirth() {
- System.out.println("setStudentBirth");
- Student instance = new Student();
- System.out.println("\tBefore Set: "+instance.getStudentBirth());
- instance.setStudentBirth("28/08/1998");
- System.out.println("\tAfter Set: "+instance.getStudentBirth());
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of getStudentAddress method, of class Student.
- */
- @Test
- public void testGetStudentAddress() {
- System.out.println("getStudentAddress");
- Student instance = new Student();
- String expResult = "bs347jz";
- instance.setStudentAddress("bs347jz");
- String result = instance.getStudentAddress();
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- /**
- * Test of setStudentAddress method, of class Student.
- */
- @Test
- public void testSetStudentAddress() {
- System.out.println("setStudentAddress");
- Student instance = new Student();
- System.out.println("\tBefore Set: "+instance.getStudentAddress());
- instance.setStudentAddress("Filton Avenue");
- System.out.println("\tAfter Set: "+instance.getStudentAddress());
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement