Esempio n. 1
0
 @Test
 public void addClient() throws NumberFormatException, InvalidInputException {
   Client c6 =
       new Client(
           "Jon",
           "B",
           infocentre,
           "*****@*****.**",
           " 187 Wilcock St",
           new Long("543253825325432"),
           "2021-05-01");
   a1.addClient(c6);
   assertTrue(infocentre.getClients().contains(c6));
 }
Esempio n. 2
0
  @Before
  public void setUp() throws Exception {
    c1 =
        new Client(
            "Smith",
            "J",
            infocentre,
            "*****@*****.**",
            "77 Huron St",
            new Long("1234122412341234"),
            "2018-09-07");
    c2 =
        new Client(
            "Jones",
            "D",
            infocentre,
            "*****@*****.**",
            "123 Elm St",
            new Long("5427633254325432"),
            "2019-11-23");
    c3 =
        new Client(
            "Sam",
            "J",
            infocentre,
            "*****@*****.**",
            "23 Gerrad St",
            new Long("6432543258263832"),
            "2020-12-03");
    c4 =
        new Client(
            "Diane",
            "H",
            infocentre,
            "*****@*****.**",
            "1101 Bay St",
            new Long("3432543209183632"),
            "2019-01-30");
    c5 =
        new Client(
            "Jonathan",
            "B",
            infocentre,
            "*****@*****.**",
            " 187 Wilcock St",
            new Long("543253825325432"),
            "2021-05-01");
    a1 = new Admin("Chris", "C", infocentre, "*****@*****.**");
    a2 = new Admin("Peter", "N", infocentre, "*****@*****.**");
    a3 = new Admin("Felicia", "D", infocentre, "*****@*****.**");
    a4 = new Admin("Dan", "H", infocentre, "*****@*****.**");
    a5 = new Admin("Will", "W", infocentre, "*****@*****.**");
    // number, departuredatetime, arrivaldatetime, ariline, origin, destination, price
    f1 =
        new Flight(
            23451, "2015-11-03 01:31", "2015-11-03 03:12", "csc", "here1", "there1", 1234.56);
    f2 =
        new Flight(23451, "2015-11-04 01:23", "2015-11-04 04:12", "csc", "here2", "there2", 123.55);
    f3 =
        new Flight(23451, "2015-11-05 02:21", "2015-11-05 06:12", "csc", "here3", "there3", 124.56);
    f4 = new Flight(23451, "2015-11-06 02:41", "2015-11-06 08:12", "csc", "here4", "there4", 234.6);
    f5 =
        new Flight(23451, "2015-11-07 01:31", "2015-11-07 07:45", "csc", "here5", "there5", 134.56);
    f6 = new Flight(23451, "2015-11-10 23:31", "2015-11-11 03:12", "csc", "here6", "there6", 23.5);

    infocentre.AddAdmin(a1);
    infocentre.AddAdmin(a2);
    infocentre.AddAdmin(a3);
    infocentre.AddAdmin(a4);
    infocentre.AddAdmin(a5);

    infocentre.AddClient(c1);
    infocentre.AddClient(c2);
    infocentre.AddClient(c3);
    infocentre.AddClient(c4);
    infocentre.AddClient(c5);
    infocentre.AddFlight(f1);
    infocentre.AddFlight(f2);
    infocentre.AddFlight(f3);
    infocentre.AddFlight(f4);
    infocentre.AddFlight(f5);
    infocentre.AddFlight(f6);
  }
Esempio n. 3
0
 @Test
 public void testRemoveFlight() {
   a1.removeFlight(f1);
   assertFalse(infocentre.getFlights().containsValue(f1));
 }
Esempio n. 4
0
 @Test
 public void testConstructor() throws NumberFormatException, InvalidInputException {
   Admin a20 = new Admin("D", "B", a1.getInfoCentre(), "*****@*****.**");
   assertTrue(infocentre.getAdmins().contains(a20));
 }