@@ -0,0 +1,1794 @@
+package org.pedrohos.business.notas;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.math.BigInteger;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.MockitoAnnotations;%0Aimport org.pedrohos.business.notas.impl.Cem;%0Aimport org.pedrohos.business.notas.impl.Cinquenta;%0Aimport org.pedrohos.business.notas.impl.Dez;%0Aimport org.pedrohos.business.notas.impl.Vinte;%0Aimport org.pedrohos.model.dto.NotaDTO;%0A%0Apublic class NotasTest %7B%0A%0A%09@InjectMocks%0A%09private Cem notaCem;%0A%0A%09@InjectMocks%0A%09private Cinquenta notaCinquenta;%0A%0A%09@InjectMocks%0A%09private Vinte notaVinte;%0A%0A%09@InjectMocks%0A%09private Dez notaDez;%0A%0A%09@Before%0A%09public void setUp() throws Exception %7B%0A%09%09MockitoAnnotations.initMocks(this);%0A%09%7D%0A%0A%09@Test%0A%09public void testeCalculoDeNotas() %7B%0A%0A%09%09List%3CNotaDTO%3E notas = new ArrayList%3CNotaDTO%3E();%0A%09%09NotaDTO nota = new NotaDTO();%0A%09%09nota.setValorRestante(new BigInteger(%22490%22));%0A%0A%09%09nota = notaCem.calcula(nota.getValorRestante());%0A%09%09notas.add(nota);%0A%0A%09%09nota = notaCinquenta.calcula(nota.getValorRestante());%0A%09%09notas.add(nota);%0A%0A%09%09nota = notaVinte.calcula(nota.getValorRestante());%0A%09%09notas.add(nota);%0A%0A%09%09nota = notaDez.calcula(nota.getValorRestante());%0A%09%09notas.add(nota);%0A%0A%09%09assertEquals(new BigInteger(%22100%22), notas.get(0).getNota());%0A%09%09assertEquals(new BigInteger(%224%22), notas.get(0).getQuantidade());%0A%09%09%0A%09%09assertEquals(new BigInteger(%2250%22), notas.get(1).getNota());%0A%09%09assertEquals(new BigInteger(%221%22), notas.get(1).getQuantidade());%0A%09%09%0A%09%09assertEquals(new BigInteger(%2220%22), notas.get(2).getNota());%0A%09%09assertEquals(new BigInteger(%222%22), notas.get(2).getQuantidade());%0A%09%09%0A%09%09assertEquals(new BigInteger(%2210%22), notas.get(3).getNota());%0A%09%09assertEquals(new BigInteger(%220%22), notas.get(3).getQuantidade());%0A%0A%09%7D%0A%0A%7D%0A

teste unitario para o calculo das notas