package business;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;

import org.junit.Before;
import org.junit.Test;

import business.Disciplina;


public class DisciplinaTestCase {
	
	Disciplina disciplina0,disciplina1, disciplina2, disciplina3;

	@Before
	public void setUp() throws Exception {
		disciplina0 = new Disciplina();
		disciplina1 = new Disciplina("111", "Disciplina111", 1);
		disciplina2 = new Disciplina("222", "Disciplina222", 2);
		disciplina3 = new Disciplina("333", "Disciplina333", 3);
	}

	@Test
	public void testDisciplina() {
	}

	@Test
	public void testDisciplinaStringStringInt() {
	}

	@Test
	public void testGetCodigo() {
		assertEquals(null, disciplina0.getCodigo());
		assertEquals("111", disciplina1.getCodigo());
		assertEquals("222", disciplina2.getCodigo());
		assertEquals("333", disciplina3.getCodigo());
	}

	@Test
	public void testSetCodigo() {
		String codigo0a = disciplina0.getCodigo();
		disciplina0.setCodigo("000");
		String codigo0b = disciplina0.getCodigo();
		String codigo1a = disciplina1.getCodigo();
		disciplina1.setCodigo("111111");
		String codigo1b = disciplina1.getCodigo();
		String codigo2a = disciplina2.getCodigo();
		disciplina2.setCodigo("222222");
		String codigo2b = disciplina2.getCodigo();
		String codigo3a = disciplina3.getCodigo();
		disciplina3.setCodigo("333333");
		String codigo3b = disciplina3.getCodigo();
		assertNotSame(codigo0a, codigo0b);
		assertSame(codigo1a, codigo1b);
		assertSame(codigo2a, codigo2b);
		assertSame(codigo3a, codigo3b);
	}

	@Test
	public void testGetNome() {
		assertEquals(null, disciplina0.getNome());
		assertEquals("Disciplina111", disciplina1.getNome());
		assertEquals("Disciplina222", disciplina2.getNome());
		assertEquals("Disciplina333", disciplina3.getNome());
	}

	@Test
	public void testSetNome() {
		String nome0a = disciplina0.getNome();
		disciplina0.setNome("Disciplina000");
		String nome0b = disciplina0.getNome();
		String nome1a = disciplina1.getNome();
		disciplina1.setNome("Disciplina111111");
		String nome1b = disciplina1.getNome();
		String nome2a = disciplina2.getNome();
		disciplina2.setNome("Disciplina222222");
		String nome2b = disciplina2.getNome();
		String nome3a = disciplina3.getNome();
		disciplina3.setNome("Disciplina333333");
		String nome3b = disciplina3.getNome();
		assertNotSame(nome0a, nome0b);
		assertNotSame(nome1a, nome1b);
		assertNotSame(nome2a, nome2b);
		assertNotSame(nome3a, nome3b);
	}

	@Test
	public void testGetCargaHoraria() {
		assertEquals(0, disciplina0.getCargaHoraria());
		assertEquals(1, disciplina1.getCargaHoraria());
		assertEquals(2, disciplina2.getCargaHoraria());
		assertEquals(3, disciplina3.getCargaHoraria());
	}

	@Test
	public void testSetCargaHoraria() {
		int cargaHoraria0a = disciplina0.getCargaHoraria();
		disciplina0.setCargaHoraria(10);
		int cargaHoraria0b = disciplina0.getCargaHoraria();
		int cargaHoraria1a = disciplina1.getCargaHoraria();
		disciplina1.setCargaHoraria(11);
		int cargaHoraria1b = disciplina1.getCargaHoraria();
		int cargaHoraria2a = disciplina2.getCargaHoraria();
		disciplina2.setCargaHoraria(22);
		int cargaHoraria2b = disciplina2.getCargaHoraria();
		int cargaHoraria3a = disciplina3.getCargaHoraria();
		disciplina3.setCargaHoraria(33);
		int cargaHoraria3b = disciplina3.getCargaHoraria();
		assertNotSame(cargaHoraria0a, cargaHoraria0b);
		assertNotSame(cargaHoraria1a, cargaHoraria1b);
		assertNotSame(cargaHoraria2a, cargaHoraria2b);
		assertNotSame(cargaHoraria3a, cargaHoraria3b);
	}

}
