Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
40
iphone/Maps/Tests/Classes/CarPlay/CarPlayServiceTests.swift
Normal file
40
iphone/Maps/Tests/Classes/CarPlay/CarPlayServiceTests.swift
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import XCTest
|
||||
@testable import CoMaps__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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue