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