Пример #1
0
  @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());
  }
Пример #2
0
 @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()));
 }
Пример #3
0
  @Test
  public void getNameReturnsFullNameIfItIsSet() {

    student.setFullName(FULLNAME);

    assertEquals(FULLNAME, student.getName());
  }
Пример #4
0
  @Test
  public void getNameReturnsConcatenatedFirstAndLastNameIfNoFullNameSet() {

    student.setFirstName(FIRSTNAME);
    student.setLastName(LASTNAME);

    assertEquals(FIRSTNAME + " " + LASTNAME, student.getName());
  }
Пример #5
0
 @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);
 }
Пример #6
0
 @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);
 }
Пример #7
0
  @Test
  public void getNameInitialisesToEmptyString() {

    assertEquals("", student.getName());
  }