You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
718 B

2 years ago
2 years ago
2 years ago
  1. package LernProgramm;
  2. import static org.junit.jupiter.api.Assertions.*;
  3. import java.io.ByteArrayInputStream;
  4. import java.io.ByteArrayOutputStream;
  5. import java.io.PrintStream;
  6. import org.junit.jupiter.api.Test;
  7. class testProgramm {
  8. @Test
  9. void test() {
  10. assertTrue(true);
  11. }
  12. @Test
  13. public void testPrimBis100() {
  14. ByteArrayOutputStream out = new ByteArrayOutputStream();
  15. System.setOut(new PrintStream(out));
  16. FunktionenAusgelagert.PrimBis100();
  17. assertEquals("2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 ", out.toString());
  18. }
  19. @Test
  20. public void testAddition() {
  21. int result = FunktionenAusgelagert.calculate("1010", "1011", '+');
  22. assertEquals(10101, result);
  23. }
  24. }