lots of exercises in java... from https://github.com/exercism/java

HelloWorldTest.java 591B

12345678910111213141516171819202122232425262728
  1. import org.junit.Test;
  2. import org.junit.Ignore;
  3. import org.junit.Ignore;
  4. import static org.junit.Assert.assertEquals;
  5. public class HelloWorldTest {
  6. @Test
  7. public void helloNoName() {
  8. assertEquals("Hello, World!", HelloWorld.hello(""));
  9. assertEquals("Hello, World!", HelloWorld.hello(null));
  10. }
  11. @Test
  12. @Ignore
  13. public void helloSampleName() {
  14. assertEquals("Hello, Alice!", HelloWorld.hello("Alice"));
  15. }
  16. @Test
  17. @Ignore
  18. public void helloAnotherSampleName() {
  19. assertEquals("Hello, Bob!", HelloWorld.hello("Bob"));
  20. }
  21. }