Skip to content

Instantly share code, notes, and snippets.

@RobertoRodrigues
Created March 20, 2011 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertoRodrigues/878658 to your computer and use it in GitHub Desktop.
Save RobertoRodrigues/878658 to your computer and use it in GitHub Desktop.
Dojo 12/03/2011 Problema FizzBuzz alterado
import junit.framework.TestCase;
public class Dojo extends TestCase {
int fizzBuzz(int valor) {
if(valor==3||valor==5){
return 1;
}
return valor;
}
//****testes****
public void teste_1() throws Exception {
assertEquals(1,fizzBuzz(1));
}
public void teste_2() throws Exception {
assertEquals(2, fizzBuzz(2));
}
public void teste_3() throws Exception{
assertEquals(1, fizzBuzz(3));
}
public void teste_4() throws Exception{
assertEquals(4, fizzBuzz(4));
}
public void teste_5() throws Exception {
assertEquals(1, fizzBuzz(5));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment