Skip to content
Snippets Groups Projects

Add tests for Lab model

All threads resolved!
Merged
Thijs Nullerequested to merge
Lab-Test into development
All threads resolved!
2 files
+ 4
8
Compare changes
  • Side-by-side
  • Inline

Files

@@ -20,6 +20,7 @@ package nl.tudelft.ewi.queue.model;
@@ -20,6 +20,7 @@ package nl.tudelft.ewi.queue.model;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.when;
 
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.time.temporal.ChronoUnit;
@@ -78,17 +79,11 @@ public class LabTest {
@@ -78,17 +79,11 @@ public class LabTest {
private RequestType submissionRequestType;
private RequestType submissionRequestType;
private Lab lab;
private Lab lab, tempLab;
private User user;
private User user;
<<<<<<< HEAD
@BeforeEach
@BeforeEach
=======
private Lab tempLab;
@Before
>>>>>>> 233f02cc... Change tempLab constructor inside @Before
@Transactional
@Transactional
public void setUp() {
public void setUp() {
questionRequestType = new RequestType("Question");
questionRequestType = new RequestType("Question");
@@ -632,7 +627,7 @@ public class LabTest {
@@ -632,7 +627,7 @@ public class LabTest {
lab.getAllowedRequestTypes().get(0), "", lab);
lab.getAllowedRequestTypes().get(0), "", lab);
r1.setSlot(new RequestSlot(LocalDateTime.of(2020, 1, 1, 0, 0), LocalDateTime.of(2020, 1, 1, 1, 0)));
r1.setSlot(new RequestSlot(LocalDateTime.of(2020, 1, 1, 0, 0), LocalDateTime.of(2020, 1, 1, 1, 0)));
tempLab.setRequests(Collections.singletonList(r1));
tempLab.setRequests(Collections.singletonList(r1));
assertThat(tempLab.position(user)).isEqualTo("00:00 - 01:00");
assertThat(tempLab.position(user)).isEqualTo("January 1 2020 at 00:00 - 01:00");
}
}
@Test
@Test
Loading