Parcial Unico/ParcialUnico2017/src/test/java/clases/TSBDeQueueTest.java
@org.junit.Test (expected = NoSuchElementException.class)
    public void testDescendingIterator() {
        System.out.println("descendingIterator");
        int as = instance.size();
        Iterator r1 = instance.descendingIterator();
        assertNotEquals(null, r1);
        assertTrue(r1.hasNext());
        assertNotEquals(null, r1.next());
        r1.remove();
        assertEquals(as - 1, instance.size());
        // Next luego de un remove no se debe saltear elementos.        
        assertEquals((Integer) 8, r1.next());
        // Opcional. 2 invocaciones seguida de remove deben fallar.
        try {
            r1.remove();
            r1.remove(); // Debe lanzar la excepcion aqui.
            fail("Debia lanzarse una excepcion IllegalStateException"); 
        } catch (IllegalStateException e) {
            // Ok
        }
        // Si se invoca a next cuando hasNext da falso debe fallar.
        Iterator i2 = empty.iterator();
        i2.next();
    }
/**
     * Test of descendingIterator method, of class TSBDeQueue.
     */
Test of descendingIterator method, of class TSBDeQueue.
Test of descendingIterator method of class TSBDeQueue .
@org.junit.Test (expected = NoSuchElementException.class)
    public void testDescendingIterator() {
        System.out.println("descendingIterator");
        int as = instance.size();
        Iterator r1 = instance.descendingIterator();
        assertNotEquals(null, r1);
        assertTrue(r1.hasNext());
        assertNotEquals(null, r1.next());
        r1.remove();
        assertEquals(as - 1, instance.size());
        assertEquals((Integer) 8, r1.next());
        try {
            r1.remove();
            r1.remove(); 
            fail("Debia lanzarse una excepcion IllegalStateException"); 
        } catch (IllegalStateException e) {
        }
        Iterator i2 = empty.iterator();
        i2.next();
    }
@ org . junit . Test ( expected = NoSuchElementException . class ) public void testDescendingIterator ( ) { System . out . println ( "descendingIterator" ) ; int as = instance . size ( ) ; Iterator r1 = instance . descendingIterator ( ) ; assertNotEquals ( null , r1 ) ; assertTrue ( r1 . hasNext ( ) ) ; assertNotEquals ( null , r1 . next ( ) ) ; r1 . remove ( ) ; assertEquals ( as - 1 , instance . size ( ) ) ; assertEquals ( ( Integer ) 8 , r1 . next ( ) ) ; try { r1 . remove ( ) ; r1 . remove ( ) ; fail ( "Debia lanzarse una excepcion IllegalStateException" ) ; } catch ( IllegalStateException e ) { } Iterator i2 = empty . iterator ( ) ; i2 . next ( ) ; }
Test of descendingIterator method, of class TSBDeQueue.
Test of descendingIterator method of class TSBDeQueue .
// Next luego de un remove no se debe saltear elementos.        
 // Opcional. 2 invocaciones seguida de remove deben fallar.
 // Debe lanzar la excepcion aqui.
 // Ok
 // Si se invoca a next cuando hasNext da falso debe fallar.
