Created
January 12, 2011 14:14
-
-
Save AlfredoCasado/776199 to your computer and use it in GitHub Desktop.
Ejemplo stub a mano
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
@Test public void | |
al_confirmar_la_compra_me_devuelve_el_importe_cobrado_usuario_sin_usar_mockito() { | |
Producto productoStubCreadoManualmente = new Producto() { | |
@Override | |
public int precio() { | |
return PRECIO_DEL_UNICO_PRODUCTO_COMPRADO; | |
} | |
}; | |
compra.anadir(productoStubCreadoManualmente); | |
int dineroCobradoAlUsuario = compra.confirmar(); | |
assertThat(dineroCobradoAlUsuario, is(equalTo(PRECIO_DEL_UNICO_PRODUCTO_COMPRADO))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment