package kr.co.zumo.app.lifeplus.bean.api;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * FAQBeanTest
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018. 10. 5.]   [최초 작성]
 * @since 2018. 10. 5.
 */
public class FAQBeanTest {

  @Test
  public void constructor() {
    FAQBean bean = new FAQBean(1, "category", "title", "contents", "data");

    assertEquals(1, bean.getId());
    assertEquals("category", bean.getCategory());
    assertEquals("title", bean.getTitle());
    assertEquals("contents", bean.getContents());
    assertEquals("data", bean.getDate());
  }

  @Test
  public void setId() {
    FAQBean bean = new FAQBean();
    bean.setId(1);

    assertEquals(1, bean.getId());
    assertEquals(null, bean.getCategory());
    assertEquals(null, bean.getTitle());
    assertEquals(null, bean.getContents());
    assertEquals(null, bean.getDate());
  }

  @Test
  public void setCategory() {
    FAQBean bean = new FAQBean();
    bean.setCategory("cate");

    assertEquals(0, bean.getId());
    assertEquals("cate", bean.getCategory());
    assertEquals(null, bean.getTitle());
    assertEquals(null, bean.getContents());
    assertEquals(null, bean.getDate());
  }

  @Test
  public void setTitle() {
    FAQBean bean = new FAQBean();
    bean.setTitle("title");

    assertEquals(0, bean.getId());
    assertEquals(null, bean.getCategory());
    assertEquals("title", bean.getTitle());
    assertEquals(null, bean.getContents());
    assertEquals(null, bean.getDate());
  }

  @Test
  public void setContents() {
    FAQBean bean = new FAQBean();
    bean.setContents("cont");

    assertEquals(0, bean.getId());
    assertEquals(null, bean.getCategory());
    assertEquals(null, bean.getTitle());
    assertEquals("cont", bean.getContents());
    assertEquals(null, bean.getDate());
  }

  @Test
  public void setDate() {
    FAQBean bean = new FAQBean();
    bean.setDate("data");

    assertEquals(0, bean.getId());
    assertEquals(null, bean.getCategory());
    assertEquals(null, bean.getTitle());
    assertEquals(null, bean.getContents());
    assertEquals("data", bean.getDate());
  }
}