001package edu.pdx.cs.joy.airline; 002 003import org.junit.jupiter.api.Test; 004 005import static org.hamcrest.CoreMatchers.*; 006import static org.hamcrest.MatcherAssert.assertThat; 007import static org.junit.jupiter.api.Assertions.assertThrows; 008 009/** 010 * Unit tests for the {@link Flight} class. 011 * 012 * You'll need to update these unit tests as you build out you program. 013 */ 014public class FlightTest { 015 016 /** 017 * This unit test will need to be modified (likely deleted) as you implement 018 * your project. 019 */ 020 @Test 021 void getArrivalStringNeedsToBeImplemented() { 022 Flight flight = new Flight(); 023 assertThrows(UnsupportedOperationException.class, flight::getArrivalString); 024 } 025 026 /** 027 * This unit test will need to be modified (likely deleted) as you implement 028 * your project. 029 */ 030 @Test 031 void initiallyAllFlightsHaveTheSameNumber() { 032 Flight flight = new Flight(); 033 assertThat(flight.getNumber(), equalTo(42)); 034 } 035 036 @Test 037 void forProject1ItIsOkayIfGetDepartureTimeReturnsNull() { 038 Flight flight = new Flight(); 039 assertThat(flight.getDeparture(), is(nullValue())); 040 } 041 042}