@@ -0,0 +1,1736 @@
+package controlador;%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Matchers.anyDouble;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport java.awt.event.ActionEvent;%0A%0Aimport modelo.TipoDeCambio;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A%0Aimport vista.IVistaConversor;%0Aimport vista.VistaEuroDolar;%0A%0Apublic class CtrConversorTest %7B%0A%0A%09private IVistaConversor mockVC;%0A%09private TipoDeCambio mockTipo;%0A%0A%09@Before%0A%09public void setUp() throws Exception %7B%0A%09%09mockVC = mock(IVistaConversor.class);%0A%09%09mockTipo = mock(TipoDeCambio.class);%0A%09%7D%0A%0A%09@After%0A%09public void tearDown() throws Exception %7B%0A%09%09mockVC = null;%0A%09%09mockTipo = null;%0A%09%7D%0A%0A%09@Test%0A%09public void testCrearControlador() %7B%0A%09%09// inicializacion-mock y stub%0A%09%09when(mockTipo.getCambioEuroDolar()).thenReturn(2.5);%0A%09%09// ejecucion%0A%09%09CtrConversor ctr = new CtrConversor(mockVC, mockTipo);%0A%0A%09%09// verificacion%0A%09%09verify(mockVC).mensaje(%0A%09%09%09%09%22vista conversor Euro-Dolar inicializado con exito%22);%0A%09%09verify(mockVC).controlador(ctr);%0A%09%09verify(mockTipo).register(ctr);%0A%09%09verify(mockVC).valorCambio(2.5);%0A%09%7D%0A%0A%09@Test%0A%09public void cambio() %7B%0A%09%09// inicializacion-mock y stub%0A%09%09ActionEvent mockEvento = mock(ActionEvent.class);%0A%09%09when(mockEvento.getActionCommand()).thenReturn(VistaEuroDolar.CAMBIO);%0A%09%09when(mockVC.obtenerCantidad()).thenReturn(2.0);%0A%09%09when(mockTipo.getCambioEuroDolar()).thenReturn(2.5);%0A%09%09// ejecucion%0A%09%09CtrConversor ctr = new CtrConversor(mockVC, mockTipo);%0A%09%09ctr.actionPerformed(mockEvento);%0A%09%09//verificacion%0A%09%09verify(mockVC,times(1)).valorDivisa(2.5*2);%0A%09%09verify(mockVC).mensaje(%22Valor divisas actualizado con exito%22);%0A%09%7D%0A%0A%7D%0A

Update CtrConversorTest.java