Repo für das Praktikum Prog3 A
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.

ForkTest.java 624B

12345678910111213141516171819202122232425262728293031
  1. package Praktikum03;
  2. import org.junit.jupiter.api.Test;
  3. import static org.junit.jupiter.api.Assertions.*;
  4. class ForkTest {
  5. @Test
  6. void getId() {
  7. Fork fork = new Fork(1);
  8. assertEquals(1, fork.getId());
  9. }
  10. @Test
  11. void take() throws InterruptedException {
  12. Fork fork = new Fork(2);
  13. assertTrue(fork.take());
  14. assertFalse(fork.take());
  15. fork.put();
  16. assertTrue(fork.take());
  17. }
  18. @Test
  19. void put() throws InterruptedException {
  20. Fork fork = new Fork(3);
  21. fork.take();
  22. fork.put();
  23. assertFalse(fork.isInUse());
  24. }
  25. }