[ios] Fix testForRaisingExceptionsOnStaleLayerObject test
This commit is contained in:
@@ -82,31 +82,31 @@
|
||||
|
||||
// Testing generated layers
|
||||
MGLLineStyleLayer *lineLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"lineLayerID" source:source];
|
||||
MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"rasterLayerID" source:source];
|
||||
MGLCircleStyleLayer *circleLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"circleLayerID" source:source];
|
||||
|
||||
[self.mapView.style addSource:source];
|
||||
[self.mapView.style addLayer:lineLayer];
|
||||
[self.mapView.style addLayer:rasterLayer];
|
||||
[self.mapView.style addLayer:circleLayer];
|
||||
|
||||
XCTAssertNoThrow(lineLayer.isVisible);
|
||||
XCTAssertNoThrow(rasterLayer.isVisible);
|
||||
XCTAssertNoThrow(circleLayer.isVisible);
|
||||
|
||||
XCTAssert(![source.description containsString:@"<unknown>"]);
|
||||
XCTAssert(![lineLayer.description containsString:@"<unknown>"]);
|
||||
XCTAssert(![rasterLayer.description containsString:@"<unknown>"]);
|
||||
XCTAssert(![circleLayer.description containsString:@"<unknown>"]);
|
||||
|
||||
self.styleLoadingExpectation = nil;
|
||||
[self.mapView setStyleURL:[[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]];
|
||||
[self waitForMapViewToFinishLoadingStyleWithTimeout:10];
|
||||
|
||||
|
||||
XCTAssert([source.description containsString:@"<unknown>"]);
|
||||
XCTAssert([lineLayer.description containsString:@"<unknown>"]);
|
||||
XCTAssert([rasterLayer.description containsString:@"<unknown>"]);
|
||||
XCTAssert([circleLayer.description containsString:@"<unknown>"]);
|
||||
|
||||
XCTAssertThrowsSpecificNamed(lineLayer.isVisible, NSException, MGLInvalidStyleLayerException, @"Layer should raise an exception if its core peer got invalidated");
|
||||
XCTAssertThrowsSpecificNamed(rasterLayer.isVisible, NSException, MGLInvalidStyleLayerException, @"Layer should raise an exception if its core peer got invalidated");
|
||||
XCTAssertThrowsSpecificNamed(circleLayer.isVisible, NSException, MGLInvalidStyleLayerException, @"Layer should raise an exception if its core peer got invalidated");
|
||||
|
||||
XCTAssertThrowsSpecificNamed([self.mapView.style removeLayer:lineLayer], NSException, NSInvalidArgumentException, @"Style should raise an exception when attempting to remove an invalid layer (e.g. if its core peer got invalidated)");
|
||||
XCTAssertThrowsSpecificNamed([self.mapView.style removeLayer:rasterLayer], NSException, NSInvalidArgumentException, @"Style should raise an exception when attempting to remove an invalid layer (e.g. if its core peer got invalidated)");
|
||||
XCTAssertThrowsSpecificNamed([self.mapView.style removeLayer:circleLayer], NSException, NSInvalidArgumentException, @"Style should raise an exception when attempting to remove an invalid layer (e.g. if its core peer got invalidated)");
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user