diff options
author | Julian Rex <julian.rex@mapbox.com> | 2018-04-19 10:53:02 -0400 |
---|---|---|
committer | Julian Rex <julian.rex@mapbox.com> | 2018-04-19 10:53:02 -0400 |
commit | 2e2612de07957d1d59fb730d250635ed8962088b (patch) | |
tree | 34d63113ffcbb52d2cbccc44b81c05ac21e15801 | |
parent | 088e8f4e8a0b61a0be8799ba6334566239282069 (diff) | |
download | qtlocation-mapboxgl-upstream/jrex-default-callout-positioning-rect.tar.gz |
Added additional related tests (and disabled 2 of them).upstream/jrex-default-callout-positioning-rect
-rw-r--r-- | platform/ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme | 10 | ||||
-rw-r--r-- | platform/ios/test/MGLAnnotationViewTests.m | 40 |
2 files changed, 48 insertions, 2 deletions
diff --git a/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme b/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme index 4679378126..afba168676 100644 --- a/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme +++ b/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme @@ -54,7 +54,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> <TestableReference @@ -66,6 +65,14 @@ BlueprintName = "test" ReferencedContainer = "container:ios.xcodeproj"> </BuildableReference> + <SkippedTests> + <Test + Identifier = "MGLAnnotationViewTests/testAnnotationViewInitWithFrame"> + </Test> + <Test + Identifier = "MGLAnnotationViewTests/testSelectingADisabledAnnotationView"> + </Test> + </SkippedTests> </TestableReference> </Testables> <MacroExpansion> @@ -84,7 +91,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/platform/ios/test/MGLAnnotationViewTests.m b/platform/ios/test/MGLAnnotationViewTests.m index 73e9d4c15a..ca48df2943 100644 --- a/platform/ios/test/MGLAnnotationViewTests.m +++ b/platform/ios/test/MGLAnnotationViewTests.m @@ -198,6 +198,46 @@ static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReu XCTAssert(reasonAfter == MGLCameraChangeReasonNone, @"Camera should not have moved"); } +- (void)checkDefaultPropertiesForAnnotationView:(MGLAnnotationView*)view { + XCTAssertNil(view.annotation); + XCTAssertNil(view.reuseIdentifier); + XCTAssertEqual(view.centerOffset.dx, 0.0); + XCTAssertEqual(view.centerOffset.dy, 0.0); + XCTAssertFalse(view.scalesWithViewingDistance); + XCTAssertFalse(view.rotatesToMatchCamera); + XCTAssertFalse(view.isSelected); + XCTAssert(view.isEnabled); + XCTAssertFalse(view.isDraggable); + XCTAssertEqual(view.dragState, MGLAnnotationViewDragStateNone); +} + +- (void)testAnnotationViewInitWithFrame { + CGRect frame = CGRectMake(10.0, 10.0, 100.0, 100.0); + MGLAnnotationView *view = [[MGLAnnotationView alloc] initWithFrame:frame]; + [self checkDefaultPropertiesForAnnotationView:view]; +} + +- (void)testAnnotationViewInitWithReuseIdentifier { + MGLAnnotationView *view = [[MGLAnnotationView alloc] initWithReuseIdentifier:nil]; + [self checkDefaultPropertiesForAnnotationView:view]; +} + +- (void)testSelectingADisabledAnnotationView { + self.prepareAnnotationView = ^(MGLAnnotationView *view) { + view.enabled = NO; + }; + + // Create annotation + MGLPointFeature *point = [[MGLPointFeature alloc] init]; + point.title = NSStringFromSelector(_cmd); + point.coordinate = CLLocationCoordinate2DMake(0.0, 0.0); + + XCTAssert(self.mapView.selectedAnnotations.count == 0, @"There should be 0 selected annotations"); + + [self.mapView selectAnnotation:point animated:NO]; + + XCTAssert(self.mapView.selectedAnnotations.count == 0, @"There should be 0 selected annotations"); +} #pragma mark - MGLMapViewDelegate - |