Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. package exo3;
  2.  
  3. import static org.junit.jupiter.api.Assertions.*;
  4. import static org.mockito.Mockito.*;
  5. import org.junit.jupiter.api.BeforeEach;
  6. import org.junit.jupiter.api.Test;
  7. import org.mockito.Mock;
  8. import org.mockito.MockitoAnnotations;
  9.  
  10. class CalculateurRomainTest {
  11.  
  12. @Mock
  13. private IConvertisseurRomain converter;
  14. private CalculateurRomain calculator;
  15.  
  16. @BeforeEach
  17. public void initialization()
  18. {
  19. MockitoAnnotations.initMocks(this);
  20. calculator = new CalculateurRomain(converter);
  21. }
  22.  
  23. @Test
  24. void shouldReturnXWhenV_V() {
  25. when(converter.romanToInt("V")).thenReturn(5);
  26. when(converter.intToRoman(10)).thenReturn("X");
  27.  
  28. assertTrue(calculator.sum("V", "V").equals("X"));
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement