|
@@ -7,21 +7,33 @@ package scot.carricksoftware.grantswriter.writer.latex.parts;
|
|
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
+import org.junit.jupiter.api.extension.ExtendWith;
|
|
|
|
+import org.mockito.Mock;
|
|
|
|
+import org.springframework.test.context.junit.jupiter.SpringExtension;
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|
|
|
+import static org.mockito.Mockito.verify;
|
|
|
|
|
|
-
|
|
|
|
|
|
+@ExtendWith(SpringExtension.class)
|
|
class WritePartsTest {
|
|
class WritePartsTest {
|
|
|
|
|
|
private WriteParts writeParts;
|
|
private WriteParts writeParts;
|
|
|
|
|
|
|
|
+ @Mock
|
|
|
|
+ PeopleParts peoplePartsMock;
|
|
|
|
+
|
|
@BeforeEach
|
|
@BeforeEach
|
|
void setUp() {
|
|
void setUp() {
|
|
- writeParts = new WritePartsImpl();
|
|
|
|
|
|
+ writeParts = new WritePartsImpl(peoplePartsMock);
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
void constructorTest(){
|
|
void constructorTest(){
|
|
assertNotNull(writeParts);
|
|
assertNotNull(writeParts);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Test
|
|
|
|
+ void writeTest(){
|
|
|
|
+ verify(writeParts).write();
|
|
|
|
+ }
|
|
}
|
|
}
|