Advertisement
Guest User

Untitled

a guest
Jun 16th, 2021
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Test result:
  2. Expected :kotlin.Pair<(null, com.test.mappytest.fizzbuzz.InvalidInputException: input One or input Two are greater then limit)>
  3. Actual :kotlin.Pair<(null, com.test.mappytest.fizzbuzz.InvalidInputException: input One or input Two are greater then limit)>
  4.  
  5. @Test
  6. fun `processing result fail`() {
  7. // Arrange
  8. val processedResult = MutableLiveData<Pair<String?, Throwable?>>()
  9. processedResult.value = Pair(null, InvalidInputException("input One or input Two are greater then limit"))
  10.  
  11. val observer = Observer<Pair<String?, Throwable?>> {}
  12. cut.processorOutputLiveData.observeForever(observer)
  13.  
  14. try {
  15. // Act
  16. cut.process(2, 3, 1, "Fi", "Bu")
  17.  
  18. // Assert
  19. Assert.assertEquals(processedResult.value, cut.processorOutputLiveData.value)
  20. } finally {
  21. cut.processorOutputLiveData.removeObserver(observer)
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement