/** Test of divide method, of class Calculadora. */ @Test public void testDivide() { System.out.println("divide"); double number1 = 0.0; double number2 = 0.0; Calculadora instance = new Calculadora(); double expResult = 0.0; double result = instance.divide(number1, number2); assertEquals(expResult, result, 0.0); // TODO review the generated test code and remove the default call to fail. // fail("The test case is a prototype."); }
/** Test of multiply method, of class Calculadora. */ @Test public void testMultiply() { System.out.println("multiply"); double number1 = 0.0; double number2 = 0.0; Calculadora instance = new Calculadora(); double expResult = 0.0; double result = instance.multiply(number1, number2); assertEquals(expResult, result, 0.0); // TODO review the generated test code and remove the default call to fail. }
@Override public void mouseClicked(MouseEvent arg0) { // TODO Auto-generated method stub try { // Para evitar excepciones cuando no hay valor. float valor1 = (Float.valueOf(((CajaTexto) objetos.get("ct1")).getText())).intValue(); float valor2 = (Float.valueOf(((CajaTexto) objetos.get("ct2")).getText())).intValue(); valor1 = calculadora.calcular(valor1, valor2); ((CajaTexto) objetos.get("ct3")).setText(String.valueOf(valor1)); } catch (Exception e) { } }
public static void main(String[] args) throws IOException { // se utiliza el metodo de la Calculadora Calculadora miCalculadora = new Calculadora(); miCalculadora.Descomposicion(); }
/** @param args the command line arguments */ public static void main(String[] args) { Calculadora calculadora = new Calculadora(); int soma = calculadora.soma(); System.out.println("Resultado = " + soma); }