package com.company;


import org.junit.Test;

import static org.junit.Assert.*;

public class OperatorTest {
    @Test
    public void testAddFlight(){
        Airplain airplain = new Airplain("booing");
        Flight flight = new Flight("98,3,1" , "15:30" , 11 , "Tehran" , "Ahvaz" , airplain , "homa");
        Operator operator = new Operator();
        operator.addFlight(flight);
        assertNotNull(operator.getFlights());
    }

    @Test
    public void testAddAirplane(){
        Airplain airplain = new Airplain("booing");
        Seat seat = new Seat("common" , 1);
        Seat seat2 = new Seat("common" , 2);
        airplain.setSeat(seat);
        airplain.setSeat(seat2);
        Operator operator = new Operator();
        operator.addAirplane(airplain);
        assertNotNull(operator.getAirplains());
    }

    @Test
    public void testRemoveFlight(){
        Airplain airplain = new Airplain("booing");
        Flight flight = new Flight("98,3,1" , "15:30" , 11 , "Tehran" , "Ahvaz" , airplain , "homa");
        Operator operator = new Operator();
        operator.addFlight(flight);
        operator.removeFlight(flight);
        assertEquals(0 , operator.getFlights().size());
    }
}
