01: package example.nz.org.take.r2ml.userv;
02:
03: import nz.org.take.rt.ResultSet;
04: import example.nz.org.take.r2ml.userv.domain.Driver;
05: import example.userv.highRiskDriver.UServKB;
06: import example.userv.highRiskDriver.highRiskDriver;
07: import junit.framework.TestCase;
08:
09: public class UServHighRiskDriverTC04 extends TestCase {
10:
11: UServKB uservkb = new UServKB();
12:
13: public void test01() {
14: Driver driver = new Driver("driver01", Driver.GENDER_FEMALE, 25);
15: ResultSet<highRiskDriver> rs = uservkb.highRiskDriver_1(driver);
16: assertFalse(rs.hasNext());
17: driver.setDui(true);
18:
19: rs = uservkb.highRiskDriver_1(driver);
20: assertTrue(rs.hasNext());
21: assertEquals(driver, rs.next().slot1);
22:
23: driver.setDui(false);
24: assertFalse(uservkb.highRiskDriver_1(driver).hasNext());
25: driver.setNumberOfAccidents(3);
26: rs = uservkb.highRiskDriver_1(driver);
27: assertTrue(rs.hasNext());
28: driver.setNumberOfAccidents(2);
29: assertFalse(uservkb.highRiskDriver_1(driver).hasNext());
30: driver.setNumberOfMovingViolations(4);
31: rs = uservkb.highRiskDriver_1(driver);
32: assertTrue(rs.hasNext());
33: assertEquals(driver, rs.next().slot1);
34: }
35:
36: }
|