Skip to content

Instantly share code, notes, and snippets.

@RobertoRodrigues
Created March 20, 2011 20:31
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/878646 to your computer and use it in GitHub Desktop.
Save RobertoRodrigues/878646 to your computer and use it in GitHub Desktop.
Dojo 11/03/2011 problema: FizzBuzz
import junit.framework.TestCase;
public class Dojo extends TestCase {
String fizzbuzz(int entrada) {
if(entrada == 3){
return "fizz";
}
return ""+entrada;
}
public void teste_1() throws Exception {
assertEquals(1,fizzbuzz(1));
}
public void teste_1() throws Exception {
assertEquals(2,fizzbuzz(2));
}
public void teste_3() throws Exception {
assertEquals("fizz", fizzbuzz(3));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment