Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. import pdi.loose.code.PDILooseCode;
  2.  
  3.  
  4.  
  5. /*
  6. * To change this license header, choose License Headers in Project Properties.
  7. * To change this template file, choose Tools | Templates
  8. * and open the template in the editor.
  9. */
  10.  
  11. /**
  12. *
  13. * @author gonca
  14. */
  15. public class Testes {
  16. public static void main(String[] args) {
  17. int [][] m= {{1,2,3},{1,2,3},{1,2,3}};
  18. System.out.println("\n\nTESTES ASSOCIADOS AO MÉTODO testesomaMatriz() ");
  19. System.out.print("\nTESTAR soma de elemenros de é correta");
  20. System.out.println("..."+ testesomaMatriz (18, m));
  21.  
  22. System.out.println("\n\nTESTES ASSOCIADOS AO MÉTODO testemediaMatriz() ");
  23. System.out.print("\nTESTAR media dos elementos de m é correta");
  24. System.out.println("..."+ testesomaMatriz (2, m));
  25. }
  26.  
  27. /**
  28. *Teste do método verificaSeTemApelido
  29. * @param resp – resposta esperada
  30. * @param m
  31. * @return – SUCESSO ou FALHA consoante passou no teste ou falhou
  32. */
  33. public static String testesomaMatriz(int resp, int [][] m){
  34. if( PDILooseCode.somaMatriz(m)==resp) {
  35. return "SUCESSO";
  36. }
  37. return "FALHA";
  38. }
  39. /**
  40. *Teste do método verificaSeTemApelido
  41. * @param resp – resposta esperada
  42. * @param m
  43. * @return – SUCESSO ou FALHA consoante passou no teste ou falhou
  44. */
  45. public static String testemediaMatriz(int resp, int [][] m){
  46. if( PDILooseCode.somaMatriz(m)==resp) {
  47. return "SUCESSO";
  48. }
  49. return "FALHA";
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement