@Test public void test() { // fail("Not yet implemented"); Student student1 = new Student("Jon"); assertEquals("Jon", student1.getName()); Student student2 = new Student("Joy"); assertEquals("Joy", student2.getName()); }
@Test public void testsameiddifferentnameEquals() { System.out.println("equals"); Student instance1 = new Student(); instance1.setName("Ranjith"); instance1.setId("c0663421"); Student instance2 = new Student(); instance2.setName("surya"); instance2.setId("c0663421"); assertFalse(instance1.getName().equals(instance2.getName())); }
@Test public void getNameReturnsFullNameIfItIsSet() { student.setFullName(FULLNAME); assertEquals(FULLNAME, student.getName()); }
@Test public void getNameReturnsConcatenatedFirstAndLastNameIfNoFullNameSet() { student.setFirstName(FIRSTNAME); student.setLastName(LASTNAME); assertEquals(FIRSTNAME + " " + LASTNAME, student.getName()); }
@Test public void namevalueTest() { System.out.println("StudentTest"); Student instance = new Student(); String expResult = "Bill Smith"; instance.setName(expResult); String result = instance.getName(); assertEquals(expResult, result); }
@Test public void nameStudentTest() { System.out.println("StudentTest"); Student instance = new Student("Bill Smith", "c0123456", "male", 89.3); assertEquals("Bill Smith", instance.getName()); assertEquals("c0123456", instance.getId()); assertEquals("male", instance.getGender()); assertEquals(89.3, instance.getGrade(), 0.0); }
@Test public void getNameInitialisesToEmptyString() { assertEquals("", student.getName()); }