Created
April 20, 2010 05:05
-
-
Save rodrigoy/372053 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import junit.framework.Assert; | |
import org.junit.Test; | |
/** | |
* Ora, pois, deve mostrar na tela há quanto tempo o pedido foi emitido... | |
* @author Joaquim Manoel | |
* | |
*/ | |
public class PedidoTest { | |
final int SEG = 1000; | |
final int MIN = 60 * SEG; | |
final int H = 60 * MIN; | |
final int DIA = 24 * H; | |
final int MES = 30 * DIA; | |
@Test | |
public void deveMostrarXXMinutos () throws Exception { | |
Pedido pedido = new Pedido(); | |
Thread.sleep(10 * MIN); | |
Assert.assertEquals("10 minutos", pedido.getEmitidoHa()); | |
} | |
@Test | |
public void deveMostrarXXDias () throws Exception { | |
Pedido pedido = new Pedido(); | |
Thread.sleep(10 * DIA); | |
Assert.assertEquals("10 dias", pedido.getEmitidoHa()); | |
} | |
@Test | |
public void deveMostrarXXMeses () throws Exception { | |
Pedido pedido = new Pedido(); | |
Thread.sleep(3 * MES); | |
Assert.assertEquals("3 Meses", pedido.getEmitidoHa()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment