public class ScenarioTest {
@Test
public void testInsertBetween() {
Scenario sc = new Scenario();
VerifyRuleFired vf = new VerifyRuleFired();
sc.insertBetween( null,
vf );
assertEquals( 1,
sc.getFixtures().size() );
assertEquals( vf,
sc.getFixtures().get( 0 ) );
VerifyRuleFired vf2 = new VerifyRuleFired();
sc.getFixtures().add( vf2 );
VerifyRuleFired vf3 = new VerifyRuleFired();
sc.insertBetween( vf,
vf3 );
assertEquals( 3,
sc.getFixtures().size() );
assertEquals( vf,
sc.getFixtures().get( 0 ) );
assertEquals( vf2,
sc.getFixtures().get( 1 ) );
assertEquals( vf3,
sc.getFixtures().get( 2 ) );
VerifyRuleFired vf4 = new VerifyRuleFired();
sc.insertBetween( vf2,
vf4 );
assertEquals( 4,
sc.getFixtures().size() );
assertEquals( 3,
sc.getFixtures().indexOf( vf4 ) );
assertEquals( 2,
sc.getFixtures().indexOf( vf3 ) );
//assertEquals(vf4, sc.fixtures.get(3));
assertEquals( 1,
sc.getFixtures().indexOf( vf2 ) );
//assertEquals(vf2, sc.fixtures.get(2));
assertEquals( 0,
sc.getFixtures().indexOf( vf ) );
VerifyRuleFired vf5 = new VerifyRuleFired();
sc.insertBetween( null,
vf5 );
assertEquals( 5,
sc.getFixtures().size() );
assertEquals( 4,