summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLCircleStyleLayerTests.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/test/MGLCircleStyleLayerTests.m')
-rw-r--r--platform/darwin/test/MGLCircleStyleLayerTests.m37
1 files changed, 37 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLCircleStyleLayerTests.m b/platform/darwin/test/MGLCircleStyleLayerTests.m
new file mode 100644
index 0000000000..f7ebcf822a
--- /dev/null
+++ b/platform/darwin/test/MGLCircleStyleLayerTests.m
@@ -0,0 +1,37 @@
+// This file is generated.
+// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
+
+#import "MGLStyleLayerTests.h"
+
+@interface MGLCircleLayerTests : MGLStyleLayerTests
+@end
+
+@implementation MGLCircleLayerTests
+
+- (void)testCircleLayer {
+ NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
+ NSURL *url = [NSURL fileURLWithPath:filePath];
+ MGLGeoJSONSource *source = [[MGLGeoJSONSource alloc] initWithSourceIdentifier:@"sourceID" URL:url];
+ MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithLayerIdentifier:@"layerID" sourceIdentifier:@"sourceID"];
+ [self.mapView.style addSource:source];
+ [self.mapView.style addLayer:layer];
+
+ layer.circleRadius = MGLRuntimeStylingHelper.testNumber;
+ layer.circleColor = MGLRuntimeStylingHelper.testColor;
+ layer.circleBlur = MGLRuntimeStylingHelper.testNumber;
+ layer.circleOpacity = MGLRuntimeStylingHelper.testNumber;
+ layer.circleTranslate = MGLRuntimeStylingHelper.testOffset;
+ layer.circleTranslateAnchor = [MGLRuntimeStylingHelper testEnum:MGLCircleStyleLayerCircleTranslateAnchorViewport type:@encode(MGLCircleStyleLayerCircleTranslateAnchor)];
+ layer.circlePitchScale = [MGLRuntimeStylingHelper testEnum:MGLCircleStyleLayerCirclePitchScaleViewport type:@encode(MGLCircleStyleLayerCirclePitchScale)];
+
+ MGLCircleStyleLayer *gLayer = [self.mapView.style layerWithIdentifier:@"layerID"];
+ XCTAssertEqualObjects(gLayer.circleRadius, MGLRuntimeStylingHelper.testNumber);
+ XCTAssertEqualObjects(gLayer.circleColor, MGLRuntimeStylingHelper.testColor);
+ XCTAssertEqualObjects(gLayer.circleBlur, MGLRuntimeStylingHelper.testNumber);
+ XCTAssertEqualObjects(gLayer.circleOpacity, MGLRuntimeStylingHelper.testNumber);
+ XCTAssertEqualObjects(gLayer.circleTranslate, MGLRuntimeStylingHelper.testOffset);
+ XCTAssert([(NSValue *)gLayer.circleTranslateAnchor objCType] == [[MGLRuntimeStylingHelper testEnum:MGLCircleStyleLayerCircleTranslateAnchorViewport type:@encode(MGLCircleStyleLayerCircleTranslateAnchor)] objCType]);
+ XCTAssert([(NSValue *)gLayer.circlePitchScale objCType] == [[MGLRuntimeStylingHelper testEnum:MGLCircleStyleLayerCirclePitchScaleViewport type:@encode(MGLCircleStyleLayerCirclePitchScale)] objCType]);
+}
+
+@end