Skip to content

Commit a6278c6

Browse files
remove unused code
1 parent 926e394 commit a6278c6

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

MapboxNavigationTests/Sources/Support/Fixture.swift

+9-23
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,22 @@ import MapboxDirections
55
import XCTest
66

77
extension Fixture {
8-
class func downloadRouteFixture(coordinates: [CLLocationCoordinate2D], fileName: String, completion: @escaping () -> Void) {
9-
let accessToken = "<# Mapbox Access Token #>"
10-
let directions = Directions(accessToken: accessToken)
11-
12-
let options = RouteOptions(coordinates: coordinates, profileIdentifier: .automobileAvoidingTraffic)
13-
options.includesSteps = true
14-
options.routeShapeResolution = .full
15-
let filePath = (NSTemporaryDirectory() as NSString).appendingPathComponent(fileName)
16-
17-
_ = directions.calculate(options, completionHandler: { _, routes, _ in
18-
guard let route = routes?.first else { return }
19-
20-
NSKeyedArchiver.archiveRootObject(route, toFile: filePath)
21-
print("Route downloaded to \(filePath)")
22-
completion()
23-
})
24-
}
25-
268
class var blankStyle: URL {
279
let path = Bundle.module.path(forResource: "EmptyStyle", ofType: "json")
2810
return URL(fileURLWithPath: path!)
2911
}
30-
12+
13+
class func routeWithBannerInstructions() -> Route {
14+
route(from: "route-with-banner-instructions", bundle: .module, waypoints: [Waypoint(coordinate: CLLocationCoordinate2D(latitude: 37.795042, longitude: -122.413165)), Waypoint(coordinate: CLLocationCoordinate2D(latitude: 37.7727, longitude: -122.433378))])
15+
}
16+
}
17+
18+
// MARK: - Private
19+
20+
private extension Fixture {
3121
class func route(from jsonFile: String, bundle: Bundle, waypoints: [Waypoint]) -> Route {
3222
let response = JSONFromFileNamed(name: jsonFile, bundle: bundle)
3323
let jsonRoute = (response["routes"] as! [AnyObject]).first as! [String: Any]
3424
return Route(json: jsonRoute, waypoints: waypoints, options: RouteOptions(waypoints: waypoints))
3525
}
36-
37-
class func routeWithBannerInstructions() -> Route {
38-
route(from: "route-with-banner-instructions", bundle: .module, waypoints: [Waypoint(coordinate: CLLocationCoordinate2D(latitude: 37.795042, longitude: -122.413165)), Waypoint(coordinate: CLLocationCoordinate2D(latitude: 37.7727, longitude: -122.433378))])
39-
}
4026
}

0 commit comments

Comments
 (0)