Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
asahiocean
SZRCAI
Commits
d3622f0c
Verified
Commit
d3622f0c
authored
Mar 10, 2021
by
asahiocean
🚀
Browse files
Tests
parent
5f7d08a5
Changes
5
Hide whitespace changes
Inline
Side-by-side
SZRCAI/SZRCAI.xcodeproj/project.pbxproj
View file @
d3622f0c
...
...
@@ -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 */
,
...
...
SZRCAI/SZRCAI/Main code/Helpers/Extensions/CLLocationCoordinate2D.swift
View file @
d3622f0c
import
Foundation
import
CoreLocation
extension
CLLocationCoordinate2D
:
Equatable
{
extension
CLLocationCoordinate2D
{
public
var
location
:
CLLocation
{
return
CLLocation
(
latitude
:
latitude
,
longitude
:
longitude
)
...
...
SZRCAI/SZRCAI/Main code/Views/MapView/MapView.swift
View file @
d3622f0c
...
...
@@ -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
...
...
SZRCAI/SZRCAITests/SZRCAITests.swift
View file @
d3622f0c
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
{
...
...
SZRCAI/SZRCAIUITests/SZRCAIUITests.swift
View file @
d3622f0c
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment