Package group

Source Code of group.GroupFactoryTest

package group;

import java.util.Date;

import org.junit.Assert;
import org.junit.Test;

import hibernate.Group;
import junit.framework.TestCase;

public class GroupFactoryTest extends TestCase{

 
 
  @Override
  protected void setUp() throws Exception {
 
   
  }
 
  @Test
  public void test01() {
   
    Group group = new Group();
    group.setGroupTitle("hello");
    group.setGroupDesc("World");
    GroupInfoJson infoJson = GroupFactory.createGroupInfoJson(group);
   
    if (infoJson.getTitle().equals(group.getGroupTitle())){
     
    }
   
    else{
      Assert.fail("Failed because titles do not match");
    }
   
    if (infoJson.getDescription().equals(group.getGroupDesc())){
     
    }
   
    else{
      Assert.fail("Failed because desc do not match");
    }
  }
 
  @Test
  public void test02(){
   
    Group groupTest = new Group();
    groupTest.setGroupTitle("hello");
    groupTest.setGroupDesc("world");
    int numberOfQuestions = 4;
    int numberOfMembers = 2;
   
    GroupDetailsJson groupDetails = GroupFactory.createGroupDetailsJson(groupTest, numberOfQuestions, numberOfMembers);
    //groupDetails.setCreateDate(groupTest.getCreateDate());
   
    if (groupDetails.getGroupTitle().equals(groupTest.getGroupTitle())){
     
    }
    else {
      Assert.fail("Failed because titles do not match");
    }
   
    if (groupDetails.getNumOfMembers() == 2) {
     
    }
    else {
      Assert.fail("Failed because number of members did not match");
    }
   
    if (groupDetails.getNumOfQuestions() == 4) {
     
    }
    else {
      Assert.fail("Failed because the number of questions did not match");
    }
   
  }
 
}
TOP

Related Classes of group.GroupFactoryTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.