diff options
author | Lloyd Sheng <i@lloydsheng.com> | 2019-03-13 13:44:51 +0800 |
---|---|---|
committer | Lloyd Sheng <i@lloydsheng.com> | 2019-03-13 13:44:51 +0800 |
commit | e890af196c5c8a348c53fdf4158cba012d0f609e (patch) | |
tree | 0f6e3f96746e5765d39e8fc411262f85109971c5 /platform/ios/test/MGLMapViewLayoutTests.m | |
parent | 0a0464639cdd72db8f0d483932a1f95516d096c5 (diff) | |
download | qtlocation-mapboxgl-upstream/lloyd-ornament-position.tar.gz |
Fix issues found in reviewupstream/lloyd-ornament-position
Diffstat (limited to 'platform/ios/test/MGLMapViewLayoutTests.m')
-rw-r--r-- | platform/ios/test/MGLMapViewLayoutTests.m | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/platform/ios/test/MGLMapViewLayoutTests.m b/platform/ios/test/MGLMapViewLayoutTests.m index 753a409a74..d902665768 100644 --- a/platform/ios/test/MGLMapViewLayoutTests.m +++ b/platform/ios/test/MGLMapViewLayoutTests.m @@ -7,7 +7,7 @@ @interface MGLOrnamentTestData : NSObject @property (nonatomic) MGLOrnamentPosition position; -@property (nonatomic) CGPoint offset; +@property (nonatomic) CGPoint margins; @property (nonatomic) CGPoint expectedOrigin; @end @@ -17,7 +17,7 @@ + (instancetype)createWithPostion:(MGLOrnamentPosition)position offset:(CGPoint)offset expectedOrigin:(CGPoint)expectedOrigin { MGLOrnamentTestData *data = [[MGLOrnamentTestData alloc] init]; data.position = position; - data.offset = offset; + data.margins = offset; data.expectedOrigin = expectedOrigin; return data; } @@ -127,24 +127,6 @@ XCTAssertEqualWithAccuracy(CGRectGetMinY(logoView.frame), expectedLogoOriginY, accuracy); } -- (void)testOrnamentPlacementInvalidArgument { - XCTAssertThrows([self.mapView setCompassViewOffset:CGPointMake(-4, -4)]); - XCTAssertThrows([self.mapView setCompassViewOffset:CGPointMake(-4, 0)]); - XCTAssertThrows([self.mapView setCompassViewOffset:CGPointMake(0, -4)]); - - XCTAssertThrows([self.mapView setScaleBarOffset:CGPointMake(-4, -4)]); - XCTAssertThrows([self.mapView setScaleBarOffset:CGPointMake(-4, 0)]); - XCTAssertThrows([self.mapView setScaleBarOffset:CGPointMake(0, -4)]); - - XCTAssertThrows([self.mapView setAttributionButtonOffset:CGPointMake(-4, -4)]); - XCTAssertThrows([self.mapView setAttributionButtonOffset:CGPointMake(-4, 0)]); - XCTAssertThrows([self.mapView setAttributionButtonOffset:CGPointMake(0, -4)]); - - XCTAssertThrows([self.mapView setLogoViewOffset:CGPointMake(-4, -4)]); - XCTAssertThrows([self.mapView setLogoViewOffset:CGPointMake(-4, 0)]); - XCTAssertThrows([self.mapView setLogoViewOffset:CGPointMake(0, -4)]); -} - - (NSArray *)makeTestDataListWithView:(UIView *)view margin:(CGFloat)margin { CGFloat bottomSafeAreaInset = 0.0; if (@available(iOS 11.0, *)) { @@ -177,7 +159,7 @@ for (MGLOrnamentTestData *testData in testDataList) { self.mapView.compassViewPosition = testData.position; - self.mapView.compassViewOffset = testData.offset; + self.mapView.compassViewMargins = testData.margins; //invoke layout [self.superView setNeedsLayout]; @@ -202,7 +184,7 @@ for (MGLOrnamentTestData *testData in testDataList) { self.mapView.scaleBarPosition = testData.position; - self.mapView.scaleBarOffset = testData.offset; + self.mapView.scaleBarMargins = testData.margins; //invoke layout [self.superView setNeedsLayout]; @@ -227,7 +209,7 @@ for (MGLOrnamentTestData *testData in testDataList) { self.mapView.attributionButtonPosition = testData.position; - self.mapView.attributionButtonOffset = testData.offset; + self.mapView.attributionButtonMargins = testData.margins; //invoke layout [self.superView setNeedsLayout]; @@ -252,7 +234,7 @@ for (MGLOrnamentTestData *testData in testDataList) { self.mapView.logoViewPosition = testData.position; - self.mapView.logoViewOffset = testData.offset; + self.mapView.logoViewMargins = testData.margins; //invoke layout [self.superView setNeedsLayout]; |