diff --git a/src/main/java/br/utfpr/tdd/ex1/Aluno.java b/src/main/java/br/utfpr/tdd/ex1/Aluno.java index 63588d7..238d1a2 100644 --- a/src/main/java/br/utfpr/tdd/ex1/Aluno.java +++ b/src/main/java/br/utfpr/tdd/ex1/Aluno.java @@ -42,10 +42,15 @@ void setNotaProjeto(double nota) { } double getNF() { - if(notaRAA < 0) + if (notaRAA < 0) { return (notaProjeto + getNAP()) / 2.0; - - return (notaProjeto + getNAP() + notaRAA) / 3.0; + } + double nota = (notaProjeto + getNAP() + notaRAA) / 3.0; + if (nota > 6) { + return 6; + } else { + return nota; + } } void setNotaRAA(double nota) { diff --git a/src/test/java/br/utfpr/tdd/ex1/AlunoTest.java b/src/test/java/br/utfpr/tdd/ex1/AlunoTest.java index a500ac5..4225a2c 100644 --- a/src/test/java/br/utfpr/tdd/ex1/AlunoTest.java +++ b/src/test/java/br/utfpr/tdd/ex1/AlunoTest.java @@ -9,6 +9,7 @@ * @author andreendo */ public class AlunoTest { + //funcionando @Test public void testNotaAtividadesTresNotas() {