Browse Source

Fix timezone difference tests.

master
Abhishek Banthia 6 months ago
parent
commit
9c104a3134
  1. 6
      Clocker/ClockerUnitTests/ClockerUnitTests.swift

6
Clocker/ClockerUnitTests/ClockerUnitTests.swift

@ -172,13 +172,13 @@ class ClockerUnitTests: XCTestCase {
func testTimeDifference() { func testTimeDifference() {
let observingDaylightSavings = TimeZone.autoupdatingCurrent.isDaylightSavingTime(for: Date()) let observingDaylightSavings = TimeZone.autoupdatingCurrent.isDaylightSavingTime(for: Date())
let expectedDifference = observingDaylightSavings ? ", +9h 30m" : ", +10h 30m" let expectedDifference = observingDaylightSavings ? ", +9h 30m" : ", +10h 30m"
let expectedDifferenceForAuckland = observingDaylightSavings ? ", +16h" : ", +18h" let expectedDifferenceForAuckland = observingDaylightSavings ? ", +16h " : ", +18h "
XCTAssertTrue(operations.timeDifference() == expectedDifference, "Difference was unexpectedly: \(operations.timeDifference())") XCTAssertTrue(operations.timeDifference() == expectedDifference, "Difference was unexpectedly: \(operations.timeDifference())")
XCTAssertTrue(californiaOperations.timeDifference() == ",-3h", "Difference was unexpectedly: \(californiaOperations.timeDifference())") XCTAssertTrue(californiaOperations.timeDifference() == ", -3h ", "Difference was unexpectedly: \(californiaOperations.timeDifference())")
XCTAssertTrue(floridaOperations.timeDifference() == "", "Difference was unexpectedly: \(floridaOperations.timeDifference())") XCTAssertTrue(floridaOperations.timeDifference() == "", "Difference was unexpectedly: \(floridaOperations.timeDifference())")
XCTAssertTrue(aucklandOperations.timeDifference() == expectedDifferenceForAuckland, "Difference was unexpectedly: \(aucklandOperations.timeDifference())") XCTAssertTrue(aucklandOperations.timeDifference() == expectedDifferenceForAuckland, "Difference was unexpectedly: \(aucklandOperations.timeDifference())")
XCTAssertTrue(omahaOperations.timeDifference() == " ,-1h", "Difference was unexpectedly: \(omahaOperations.timeDifference())") XCTAssertTrue(omahaOperations.timeDifference() == ", -1h ", "Difference was unexpectedly: \(omahaOperations.timeDifference())")
} }
func testSunriseSunset() { func testSunriseSunset() {

Loading…
Cancel
Save