summaryrefslogtreecommitdiff
path: root/platform/ios/test/MGLSourceTests.m
blob: 90ec4e3a0ba438f005553e6e3c00aa07841852f9 (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
#import "MGLMapViewTests.h"

@interface MGLSourceTests : MGLMapViewTests

@end

@implementation MGLSourceTests

- (void)testDuplicateSources {
    MGLVectorSource *source1 = [[MGLVectorSource alloc] initWithIdentifier:@"my-source" URL:[NSURL URLWithString:@"mapbox://mapbox.mapbox-terrain-v2"]];
    MGLVectorSource *source2 = [[MGLVectorSource alloc] initWithIdentifier:@"my-source" URL:[NSURL URLWithString:@"mapbox://mapbox.mapbox-terrain-v2"]];
    
    [self.mapView.style addSource: source1];
    
    @try {
        [self.mapView.style addSource: source2];
        XCTFail(@"Should not have reached this point");
    }
    @catch (NSException *e) {
        XCTAssertNotNil(e, @"Should have thrown an exception");
    }
}

@end