Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eseidel committed Feb 18, 2024
1 parent 654114b commit 6579ea1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/cli/test/behavior/buy_ship_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ void main() {
registerFallbackValue(Transaction.fallbackValue());
when(() => db.insertTransaction(any())).thenAnswer((_) => Future.value());

registerFallbackValue(ShipyardListing.fallbackValue());
when(() => db.upsertShipyardListing(any()))
.thenAnswer((_) => Future.value());

final logger = _MockLogger();
expect(
await runWithLogger(
Expand Down
6 changes: 6 additions & 0 deletions packages/types/lib/src/shipyard_listing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ class ShipyardListing {
required this.shipTypes,
});

/// Creates a shipyard listing with a fallback value.
@visibleForTesting
ShipyardListing.fallbackValue()
: waypointSymbol = WaypointSymbol.fromString('W-A-Y'),
shipTypes = {};

/// Creates a new shipyard description from JSON data.
factory ShipyardListing.fromJson(Map<String, dynamic> json) {
final symbol = WaypointSymbol.fromJson(json['waypointSymbol'] as String);
Expand Down

0 comments on commit 6579ea1

Please sign in to comment.