Skip to content

Commit

Permalink
feat(Station): Potomac Yard is open! (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
emma-k-alexandra committed Jun 5, 2023
1 parent 4856ac0 commit 80ca666
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

## v15.1 - Potomac Yard

Potomac Yard station is now open, so a few non-breaking changes are happening in `Station`.

- `Station.allOpen` now returns all stations, so it is an alias for `Station.allCases` for now.
- `Station.open` always returns `true` since all stations are open.
- `Station.potomacYard.name` now returns `"Potomac Yard-VT"` instead of `"Potomac Yard"`, properly reflecting the official name of the station.
14 changes: 7 additions & 7 deletions Sources/WMATA/Station.swift
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public extension Station {
return "Ronald Reagan Washington National Airport"

case .potomacYard:
return "Potomac Yard"
return "Potomac Yard-VT"

case .braddockRoad:
return "Braddock Road"
Expand Down Expand Up @@ -478,18 +478,18 @@ public extension Station {
}
}

/// Indicates if a station is open to the public.
/// Indicates if a station is open to the public. Currently, all stations are open.
///
/// - Returns: `false` if this station is Potomac Yard. Otherwise `true`.
/// - Returns: `true`
var open: Bool {
Station.allOpen.contains(self)
true
}

/// All stations that are currently open to the public.
/// All stations that are currently open to the public. Currently, all stations are open, so this is an alias for `Station.allCases`.
///
/// Potomac Yard is excluded.
/// - Returns: All stations.
static var allOpen: [Station] {
[.metroCenterUpper, .farragutNorth, .dupontCircle, .woodleyPark, .clevelandPark, .vanNess, .tenleytown, .friendshipHeights, .bethesda, .medicalCenter, .grosvenor, .northBethesda, .twinbrook, .rockville, .shadyGrove, .galleryPlaceUpper, .judiciarySquare, .unionStation, .rhodeIslandAve, .brookland, .fortTottenUpper, .takoma, .silverSpring, .forestGlen, .wheaton, .glenmont, .noma, .metroCenterLower, .mcphersonSquare, .farragutWest, .foggyBottom, .rosslyn, .arlingtonCemetery, .pentagon, .pentagonCity, .crystalCity, .ronaldReaganWashingtonNationalAirport, .braddockRoad, .kingSt, .eisenhowerAvenue, .huntington, .federalTriangle, .smithsonian, .lenfantPlazaLower, .federalCenterSW, .capitolSouth, .easternMarket, .potomacAve, .stadium, .minnesotaAve, .deanwood, .cheverly, .landover, .newCarrollton, .mtVernonSq7thSt, .shaw, .uStreet, .columbiaHeights, .georgiaAve, .fortTottenLower, .westHyattsville, .hyattsvilleCrossing, .collegePark, .greenbelt, .galleryPlaceLower, .archives, .lenfantPlazaUpper, .waterfront, .navyYard, .anacostia, .congressHeights, .southernAvenue, .naylorRoad, .suitland, .branchAve, .benningRoad, .capitolHeights, .addisonRoad, .morganBoulevard, .downtownLargo, .vanDornStreet, .franconia, .courtHouse, .clarendon, .virginiaSquare, .ballston, .eastFallsChurch, .westFallsChurch, .dunnLoring, .vienna, .mcLean, .tysons, .greensboro, .springHill, .wiehle, .restonTownCenter, .herndon, .innovationCenter, .washingtonDullesInternationalAirport, .loudounGateway, .ashburn]
Station.allCases
}

/// The station located within the same physical station as this station.
Expand Down
8 changes: 4 additions & 4 deletions Tests/WMATATests/TestRail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ final class RailTests: XCTestCase {
case let .failure(error):
print(error)
}

await waitForExpectations(timeout: 2)
await fulfillment(of: [exp], timeout: 2)
}

func testAllEntrances() {
Expand Down Expand Up @@ -458,7 +458,7 @@ final class RailTests: XCTestCase {
}
}

waitForExpectations(timeout: 2)
waitForExpectations(timeout: 4)
}

func testElevatorAndEscalatorIncidentsWithDelegate() {
Expand Down Expand Up @@ -1192,7 +1192,7 @@ final class RailCombineTests: CombineTests {

deferCancellable(cancellable)

waitForExpectations(timeout: 2)
waitForExpectations(timeout: 4)
}

func testPathPublisher() {
Expand Down

0 comments on commit 80ca666

Please sign in to comment.