simon.vergauwen
08/05/2016, 1:46 PM@Test
fun testPopOnlyOnce() {
bitmapStack.push(bitmap)
bitmapStack.pop().subscribe(testSubscriber)
testSubscriber.assertNoErrors()
testSubscriber.onNextEvents
testSubscriber.assertCompleted()
testSubscriber.assertTerminalEvent()
val testErrorSubscriber = TestSubscriber<Bitmap>()
bitmapStack.pop().subscribe(testErrorSubscriber)
val error = testErrorSubscriber.onErrorEvents
assertNotNull(error)
assertFalse(error.isEmpty())
assertEquals("No bitmap on the stack",error[0].message)
}