summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLRuntimeStylingTests.m.ejs
blob: 720ee4547ec686f0c4797b3fcebe58643711f248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<%
  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

- (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];
    MGLGeoJSONSource *source = [[MGLGeoJSONSource 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) %>
<% } -%>
}

@end