100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

Ejercicio calculadora JUnit

Rating
-
Sold
-
Pages
4
Uploaded on
07-04-2024
Written in
2021/2022

Ejercicio calculadora JUnit. Asignatura de entornos de desarrollo del CFGS Desarrollo de aplicaciones multiplataforma

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Course

Document information

Uploaded on
April 7, 2024
Number of pages
4
Written in
2021/2022
Type
Other
Person
Unknown

Subjects

Content preview

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)
@SuiteClasses({ CalculadoraParametroTest.class,
CalculadoraTest.class })
public class AllTests {

}




public class Calculadora {

boolean tienePantalla = false;

public int suma(int a, int b) {
return a+b;
}

public boolean isTienePantalla() {
return tienePantalla;
}


public int dividir(int a, int b) {
if (b == 0) throw new ArithmeticException("División por
cero");
int resultado = a/b;
return resultado;
}

public void setTienePantalla(boolean tienePantalla) {
this.tienePantalla = tienePantalla;
}

@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (!(obj instanceof Calculadora)) return false;
Calculadora other = (Calculadora)obj;
return (this.tienePantalla==other.tienePantalla);

}

public void loop() {
//while(true) {}

}

}
$8.68
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
saragonzalo

Get to know the seller

Seller avatar
saragonzalo juan de la cierva
Follow You need to be logged in order to follow users or courses
Sold
1
Member since
1 year
Number of followers
0
Documents
115
Last sold
8 months ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions