MockDeviceVendorInfoLoader.simulateDelay constructor

MockDeviceVendorInfoLoader.simulateDelay(
  1. BiosInfo biosInfo,
  2. BoardInfo boardInfo,
  3. SystemInfo systemInfo, {
  4. Duration initialDelay,
  5. Duration latestResponse,
})

Assign biosInfo, boardInfo and systemInfo with random generated delay for more realistic emulation on fetching data.

The Duration of random generated delay is based on a range from initialDelay to latestResponse and pick a Duration value between the range in milliseconds. Hence, applying negative Duration or initialDelay is greater than latestResponse will throw ArgumentError.

Implementation

factory MockDeviceVendorInfoLoader.simulateDelay(
    BiosInfo biosInfo, BoardInfo boardInfo, SystemInfo systemInfo,
    {Duration initialDelay,
    Duration latestResponse}) = _DelayedMockDeviceVendorInfoLoader;