diff --git a/packages/cli/test/behavior/buy_ship_test.dart b/packages/cli/test/behavior/buy_ship_test.dart index b10ec9c8..7f32bc1d 100644 --- a/packages/cli/test/behavior/buy_ship_test.dart +++ b/packages/cli/test/behavior/buy_ship_test.dart @@ -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( diff --git a/packages/types/lib/src/shipyard_listing.dart b/packages/types/lib/src/shipyard_listing.dart index 74061eb7..e3821745 100644 --- a/packages/types/lib/src/shipyard_listing.dart +++ b/packages/types/lib/src/shipyard_listing.dart @@ -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 json) { final symbol = WaypointSymbol.fromJson(json['waypointSymbol'] as String);