MockOnlineSim constructor

MockOnlineSim({
  1. String apiKey = 'mock-key',
  2. double balance = 100,
  3. MockPrices prices = defaultMockPrices,
  4. Map<int, MockRentTariff> rentTariffs = defaultMockRentTariffs,
  5. int guardInterval = 0,
})

Creates a mock.

apiKey is the key it accepts as Authorization: Bearer <apiKey>. balance is the starting balance, USD. prices and rentTariffs replace defaultMockPrices and defaultMockRentTariffs. With guardInterval (seconds) > 0 an operation without SMS, or an unconfirmed rent without any SMS, cannot be closed (NO_COMPLETE_TZID).

Implementation

MockOnlineSim({
  String apiKey = 'mock-key',
  double balance = 100,
  MockPrices prices = defaultMockPrices,
  Map<int, MockRentTariff> rentTariffs = defaultMockRentTariffs,
  int guardInterval = 0,
}) : _state = _MockState(
        apiKey: apiKey,
        guardInterval: guardInterval,
        prices: prices,
        rentTariffs: rentTariffs,
        balanceMills: _toMills(balance),
      );