Skip to content

Commit

Permalink
Fix compass tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdostal committed May 8, 2023
1 parent 1ec468d commit 79a43d1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Tests/ArcGISToolkitTests/CompassTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,33 @@ final class CompassTests: XCTestCase {
/// is applied.
func testHiddenWithAutoHideOff() {
let compass1Heading = Double.zero
let compass1 = Compass(heading: compass1Heading)
.autoHideDisabled() as! Compass
let compass1 = Compass(rotation: compass1Heading, mapViewProxy: nil, action: nil)
.autoHideDisabled()
XCTAssertFalse(compass1.shouldHide(forHeading: compass1Heading))

let compass2Heading = 45.0
let compass2 = Compass(heading: compass2Heading)
.autoHideDisabled() as! Compass
let compass2 = Compass(rotation: compass2Heading, mapViewProxy: nil, action: nil)
.autoHideDisabled()
XCTAssertFalse(compass2.shouldHide(forHeading: compass2Heading))

let compass3Heading = Double.nan
let compass3 = Compass(heading: compass3Heading)
.autoHideDisabled() as! Compass
let compass3 = Compass(rotation: compass3Heading, mapViewProxy: nil, action: nil)
.autoHideDisabled()
XCTAssertFalse(compass3.shouldHide(forHeading: compass3Heading))
}

/// Verifies that the compass accurately indicates when it should be hidden.
func testHiddenWithAutoHideOn() {
let compass1Heading: Double = .zero
let compass1 = Compass(heading: compass1Heading)
let compass1 = Compass(rotation: compass1Heading, mapViewProxy: nil, action: nil)
XCTAssertTrue(compass1.shouldHide(forHeading: compass1Heading))

let compass2Heading = 45.0
let compass2 = Compass(heading: compass2Heading)
let compass2 = Compass(rotation: compass2Heading, mapViewProxy: nil, action: nil)
XCTAssertFalse(compass2.shouldHide(forHeading: compass2Heading))

let compass3Heading = Double.nan
let compass3 = Compass(heading: compass3Heading)
let compass3 = Compass(rotation: compass3Heading, mapViewProxy: nil, action: nil)
XCTAssertTrue(compass3.shouldHide(forHeading: compass3Heading))
}
}

0 comments on commit 79a43d1

Please sign in to comment.