<% const type = locals.type; const layoutProperties = locals.layoutProperties; const paintProperties = locals.paintProperties; -%> // This file is generated. // Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. #import "MGLStyleLayerTests.h" @interface MGL<%- camelize(type) %>LayerTests : MGLStyleLayerTests @end @implementation MGL<%- camelize(type) %>LayerTests + (NSString *)layerType { return @"<%- type %>"; } - (void)test<%- camelize(type) %>Layer { <% if (type === 'background') { -%> MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID"]; <% } else { -%> NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"]; NSURL *url = [NSURL fileURLWithPath:filePath]; MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil]; [self.mapView.style addSource:source]; MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID" source:source]; <% } -%> [self.mapView.style addLayer:layer]; <% for (const property of layoutProperties) { -%> <%- testImplementation(property, type) %> <% } -%> <% for (const property of paintProperties) { -%> <%- testImplementation(property, type) %> <% } -%> MGL<%- camelize(type) %>StyleLayer *gLayer = (MGL<%- camelize(type) %>StyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"]; XCTAssertTrue([gLayer isKindOfClass:[MGL<%- camelize(type) %>StyleLayer class]]); <% for (const property of layoutProperties) { -%> <%- testGetterImplementation(property, type) %> <% } -%> <% for (const property of paintProperties) { -%> <%- testGetterImplementation(property, type) %> <% } -%> <% for (const property of layoutProperties) { -%> <%- testImplementation(property, type, true) %> <% } -%> <% for (const property of paintProperties) { -%> <%- testImplementation(property, type, true) %> <% } -%> <% for (const property of layoutProperties) { -%> <%- testGetterImplementation(property, type, true) %> <% } -%> <% for (const property of paintProperties) { -%> <%- testGetterImplementation(property, type, true) %> <% } -%> } - (void)testPropertyNames { <% for (const property of layoutProperties) { -%> [self testPropertyName:@"<%- property.getter || property.name %>" isBoolean:<%- property.type === 'boolean' ? 'YES' : 'NO' %>]; <% } -%> <% for (const property of paintProperties) { -%> [self testPropertyName:@"<%- property.getter || property.name %>" isBoolean:<%- property.type === 'boolean' ? 'YES' : 'NO' %>]; <% } -%> } @end