Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !!!!!TESTE!!!!!!
- --------------------------------------------------------------------------------
- @Test(expected=Exception.class)
- public void testConstrutor() throws Exception {
- Circulo c3 = new Circulo(new Ponto2D(0,0), -0.001);
- }
- ================================================================================
- !!!!!!MEU CÓDIGO!!!!!!!
- --------------------------------------------------------------------------------
- public Circulo(Ponto2D ponto2D, double d) throws Exception{
- if((area < 0.0)){
- throw new Exception("nao pode ser negativo");
- }
- if(raio < 0.0){
- throw new Exception("nao pode ser negativo");
- }
- if(perimetro < 0.0){
- throw new Exception("nao pode ser negativo");
- }
- this.area = area;
- this.raio = d;
- this.perimetro = perimetro;
- this.centro = centro;
- }
Add Comment
Please, Sign In to add comment