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
Module








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

Written for

Module

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) {}

}

}
£6.42
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 exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions