mockOn static method

  1. @visibleForTesting
void mockOn({
  1. String? deviceId,
  2. String? osName,
  3. String? osVersion,
  4. num? osVersionCode,
  5. String? softwareName,
  6. String? softwareVersion,
  7. String? applicationId,
  8. String? applicationType,
  9. String? applicationName,
  10. String? applicationVersion,
  11. String? applicationBuildCode,
})

Change to test mode.

Implementation

@visibleForTesting
static void mockOn({
  String? deviceId,
  String? osName,
  String? osVersion,
  num? osVersionCode,
  String? softwareName,
  String? softwareVersion,
  String? applicationId,
  String? applicationType,
  String? applicationName,
  String? applicationVersion,
  String? applicationBuildCode,
}) {
  _isMockMode = true;
  _mockData = DeviceInformation();

  if (deviceId?.isNotEmpty ?? false) {
    _mockData.deviceId = deviceId!;
  }
  if (osName?.isNotEmpty ?? false) {
    _mockData.osName = osName!;
  }
  if (osVersion?.isNotEmpty ?? false) {
    _mockData.osVersion = osVersion!;
  }
  if (osVersionCode != null) {
    _mockData.osVersionCode = osVersionCode;
  }
  if (softwareName?.isNotEmpty ?? false) {
    _mockData.softwareName = softwareName!;
  }
  if (softwareVersion?.isNotEmpty ?? false) {
    _mockData.softwareVersion = softwareVersion!;
  }
  if (applicationId?.isNotEmpty ?? false) {
    _mockData.applicationId = applicationId!;
  }
  if (applicationType?.isNotEmpty ?? false) {
    _mockData.applicationType = applicationType!;
  }
  if (applicationName?.isNotEmpty ?? false) {
    _mockData.applicationName = applicationName!;
  }
  if (applicationVersion?.isNotEmpty ?? false) {
    _mockData.applicationVersion = applicationVersion!;
  }
  if (applicationBuildCode?.isNotEmpty ?? false) {
    _mockData.applicationBuildCode = applicationBuildCode!;
  }
}