Files
comaps/iphone/Maps/Tests/Classes/CarPlay/CarPlayServiceTests.swift
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

41 lines
1.2 KiB
Swift

import XCTest
@testable import Organic_Maps__Debug_
final class CarPlayServiceTests: XCTestCase {
var carPlayService: CarPlayService!
override func setUp() {
super.setUp()
carPlayService = CarPlayService()
}
override func tearDown() {
carPlayService = nil
super.tearDown()
}
func testCreateEstimates() {
let routeInfo = RouteInfo(timeToTarget: 100,
targetDistance: 25.2,
targetUnitsIndex: 1, // km
distanceToTurn: 0.5,
turnUnitsIndex: 0, // m
streetName: "Niamiha",
turnImageName: nil,
nextTurnImageName: nil,
speedMps: 40.5,
speedLimitMps: 60,
roundExitNumber: 0)
let estimates = carPlayService.createEstimates(routeInfo: routeInfo)
guard let estimates else {
XCTFail("Estimates should not be nil.")
return
}
XCTAssertEqual(estimates.distanceRemaining, Measurement<UnitLength>(value: 25.2, unit: .kilometers))
XCTAssertEqual(estimates.timeRemaining, 100)
}
}