Verified Commit d3622f0c authored by asahiocean's avatar asahiocean 🚀
Browse files

Tests

parent 5f7d08a5
......@@ -78,6 +78,8 @@
3DD5F3B625F8611600923766 /* MKPolyline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DD5F3B325F8611600923766 /* MKPolyline.swift */; };
3DD5F3C925F8652A00923766 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3DD5F27425F853EB00923766 /* LaunchScreen.storyboard */; };
3DD5F3CD25F8652B00923766 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3DD5F27425F853EB00923766 /* LaunchScreen.storyboard */; };
3DD5F3E025F86B6900923766 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DD5F26D25F853E900923766 /* ViewController.swift */; };
3DD5F3E425F86B6900923766 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DD5F26D25F853E900923766 /* ViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -532,6 +534,7 @@
3DD5F39125F8601600923766 /* alertAuthorizedWhenInUse.swift in Sources */,
3DD5F33825F85B3F00923766 /* DashLine.swift in Sources */,
3DD5F36925F85DFB00923766 /* UIEdgeInsets.swift in Sources */,
3DD5F3E025F86B6900923766 /* ViewController.swift in Sources */,
3DD5F37025F85E1E00923766 /* action+Model.swift in Sources */,
3DD5F2EE25F8585D00923766 /* Model.swift in Sources */,
3DD5F2FA25F858B100923766 /* MapView.swift in Sources */,
......@@ -560,6 +563,7 @@
3DD5F39225F8601600923766 /* alertAuthorizedWhenInUse.swift in Sources */,
3DD5F33925F85B3F00923766 /* DashLine.swift in Sources */,
3DD5F36A25F85DFB00923766 /* UIEdgeInsets.swift in Sources */,
3DD5F3E425F86B6900923766 /* ViewController.swift in Sources */,
3DD5F37125F85E1E00923766 /* action+Model.swift in Sources */,
3DD5F2EF25F8585D00923766 /* Model.swift in Sources */,
3DD5F2FB25F858B100923766 /* MapView.swift in Sources */,
......
import Foundation
import CoreLocation
extension CLLocationCoordinate2D: Equatable {
extension CLLocationCoordinate2D {
public var location: CLLocation {
return CLLocation(latitude: latitude, longitude: longitude)
......
......@@ -25,9 +25,13 @@ class MapView: MKMapView {
showsUserLocation = true
userTrackingMode = .none
showsPointsOfInterest = true
if #available(iOS 13.0, *) {
pointOfInterestFilter = .none
} else {
showsPointsOfInterest = true
}
showsCompass = true
showsScale = true
isZoomEnabled = true
......
import XCTest
import MapKit
@testable import SZRCAI
class SZRCAITests: XCTestCase {
var viewController : ViewController!
override func setUp() {
super.setUp()
viewController = ViewController()
if viewController != nil {
viewController.loadView()
viewController.viewDidLoad()
}
}
override func setUpWithError() throws {
}
override func tearDownWithError() throws {
}
func testExample() throws {
func testingVC() throws {
XCTAssertTrue(viewController != nil)
XCTAssertTrue(viewController.mapView != nil)
XCTAssertTrue(viewController.mainButton != nil)
XCTAssertTrue(viewController.clearButton != nil)
XCTAssertTrue(viewController.buttonKVO != nil)
XCTAssertTrue(viewController.pinsKVO != nil)
}
func testVCdelegate() {
XCTAssertTrue(Model.shared.delegate === viewController)
}
func testUserLocation() {
viewController.mapView.lm?.startUpdatingLocation()
XCTAssertTrue(viewController.mapView.userLocation.coordinate != .init())
}
func testPerformanceExample() throws {
......
......@@ -12,6 +12,15 @@ class SZRCAIUITests: XCTestCase {
func testExample() throws {
let app = XCUIApplication()
app.launch()
let arcticOceanMap = app.maps.containing(.other, identifier:"Arctic Ocean").element
arcticOceanMap.tap()
arcticOceanMap.tap()
app.maps.containing(.other, identifier:"Russia").element.swipeRight()
let russiaMap = app.maps.containing(.other, identifier:"Russia").element
russiaMap.swipeRight()
russiaMap.swipeRight()
}
func testLaunchPerformance() throws {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment