summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLSourceQueryTests.m
blob: d1ef180a523cd2404be920a9a6103cd6e20733da (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
#import <Mapbox/Mapbox.h>
#import <XCTest/XCTest.h>

@interface MGLSourceQueryTests : XCTestCase <MGLMapViewDelegate>

@end

@implementation MGLSourceQueryTests

- (void) testQueryVectorSource {
    MGLVectorSource *source = [[MGLVectorSource alloc] initWithIdentifier:@"vector" tileURLTemplates:@[@"fake"] options:nil];
    NSSet *sourceLayers = [NSSet setWithObjects:@"buildings", @"water", nil];
    NSArray* features = [source featuresInSourceLayersWithIdentifiers:sourceLayers predicate:nil];
    // Source not added yet, so features is 0
    XCTAssertEqual([features count], 0);
}

- (void) testQueryShapeSource {
    MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"shape" shape:[MGLShapeCollection shapeCollectionWithShapes:@[]] options:nil];
    NSArray* features = [source featuresMatchingPredicate:nil];
    // Source not added yet, so features is 0
    XCTAssertEqual([features count], 0);
}

@end