diff options
Diffstat (limited to 'platform/darwin/test/MGLStyleValueTests.swift')
-rw-r--r-- | platform/darwin/test/MGLStyleValueTests.swift | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/platform/darwin/test/MGLStyleValueTests.swift b/platform/darwin/test/MGLStyleValueTests.swift index f7bf343852..bf01435114 100644 --- a/platform/darwin/test/MGLStyleValueTests.swift +++ b/platform/darwin/test/MGLStyleValueTests.swift @@ -1,14 +1,16 @@ import XCTest import Mapbox -class MGLStyleValueTests: XCTestCase { + +extension MGLStyleValueTests { + func testConstantValues() { - let geoJSONSource = MGLGeoJSONSource(identifier: "test", features: [], options: nil) - let symbolStyleLayer = MGLSymbolStyleLayer(identifier: "test", source: geoJSONSource) + let shapeSource = MGLShapeSource(identifier: "test", shape: nil, options: nil) + let symbolStyleLayer = MGLSymbolStyleLayer(identifier: "test", source: shapeSource) // Boolean - symbolStyleLayer.iconAllowOverlap = MGLStyleConstantValue(rawValue: true) - XCTAssertEqual((symbolStyleLayer.iconAllowOverlap as! MGLStyleConstantValue<NSNumber>).rawValue, true) + symbolStyleLayer.iconAllowsOverlap = MGLStyleConstantValue(rawValue: true) + XCTAssertEqual((symbolStyleLayer.iconAllowsOverlap as! MGLStyleConstantValue<NSNumber>).rawValue, true) // Number symbolStyleLayer.iconHaloWidth = MGLStyleConstantValue(rawValue: 3) @@ -20,8 +22,8 @@ class MGLStyleValueTests: XCTestCase { } func testFunctions() { - let geoJSONSource = MGLGeoJSONSource(identifier: "test", features: [], options: nil) - let symbolStyleLayer = MGLSymbolStyleLayer(identifier: "test", source: geoJSONSource) + let shapeSource = MGLShapeSource(identifier: "test", shape: nil, options: nil) + let symbolStyleLayer = MGLSymbolStyleLayer(identifier: "test", source: shapeSource) // Boolean let stops: [NSNumber: MGLStyleValue<NSNumber>] = [ @@ -29,8 +31,8 @@ class MGLStyleValueTests: XCTestCase { 2: MGLStyleValue(rawValue: false), 3: MGLStyleValue(rawValue: true), 4: MGLStyleValue(rawValue: false), - ] - symbolStyleLayer.iconAllowOverlap = MGLStyleFunction<NSNumber>(base: 1, stops: stops) - XCTAssertEqual((symbolStyleLayer.iconAllowOverlap as! MGLStyleFunction<NSNumber>), MGLStyleFunction(base: 1, stops: stops)) + ] + symbolStyleLayer.iconAllowsOverlap = MGLStyleFunction<NSNumber>(base: 1, stops: stops) + XCTAssertEqual((symbolStyleLayer.iconAllowsOverlap as! MGLStyleFunction<NSNumber>), MGLStyleFunction(base: 1, stops: stops)) } } |