You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.0 KiB
60 lines
2.0 KiB
6 years ago
|
// Copyright © 2015 Abhishek Banthia
|
||
|
|
||
4 years ago
|
import CoreModelKit
|
||
4 years ago
|
import Foundation
|
||
6 years ago
|
import XCTest
|
||
6 years ago
|
|
||
4 years ago
|
class TimezoneDataEqualityTests: XCTestCase {
|
||
4 years ago
|
func testEqualityWhenTimezoneIdentifiersDiffer() {
|
||
4 years ago
|
let timezone1 = TimezoneData()
|
||
4 years ago
|
timezone1.timezoneID = TimeZone.autoupdatingCurrent.identifier
|
||
|
timezone1.formattedAddress = "SameLabel"
|
||
4 years ago
|
|
||
4 years ago
|
let timezone2 = TimezoneData()
|
||
|
timezone2.timezoneID = "Africa/Banjul"
|
||
|
timezone2.formattedAddress = "SameLabel"
|
||
|
|
||
|
XCTAssertNotEqual(timezone1, timezone2)
|
||
|
}
|
||
|
|
||
|
func testEqualityWhenTimezonesLabelsDiffer() {
|
||
|
let timezone1 = TimezoneData()
|
||
|
timezone1.timezoneID = TimeZone.autoupdatingCurrent.identifier
|
||
|
timezone1.formattedAddress = "SameLabel"
|
||
|
|
||
|
let timezone2 = TimezoneData()
|
||
|
timezone2.timezoneID = TimeZone.autoupdatingCurrent.identifier
|
||
|
timezone2.formattedAddress = "DifferentLabel"
|
||
|
|
||
|
XCTAssertNotEqual(timezone1, timezone2)
|
||
|
}
|
||
|
|
||
|
func testEqualityWhenTimezonesPlaceIDsAreSame() {
|
||
|
let timezone1 = TimezoneData()
|
||
|
timezone1.timezoneID = TimeZone.autoupdatingCurrent.identifier
|
||
|
timezone1.placeID = "SamplePlaceID"
|
||
|
timezone1.formattedAddress = "SameLabel"
|
||
|
|
||
|
let timezone2 = TimezoneData()
|
||
|
timezone2.placeID = "SamplePlaceID"
|
||
|
timezone2.timezoneID = TimeZone.autoupdatingCurrent.identifier
|
||
|
timezone2.formattedAddress = "DifferentLabel"
|
||
|
|
||
|
XCTAssertEqual(timezone1, timezone2)
|
||
|
}
|
||
|
|
||
|
func testEqualityWhenTimezonesPlaceIDsDiffer() {
|
||
|
let timezone1 = TimezoneData()
|
||
|
timezone1.timezoneID = TimeZone.autoupdatingCurrent.identifier
|
||
|
timezone1.placeID = "SamplePlaceID1"
|
||
|
timezone1.formattedAddress = "SameLabel"
|
||
|
|
||
|
let timezone2 = TimezoneData()
|
||
|
timezone2.placeID = "SamplePlaceID2"
|
||
|
timezone2.timezoneID = TimeZone.autoupdatingCurrent.identifier
|
||
|
timezone2.formattedAddress = "DifferentLabel"
|
||
|
|
||
|
XCTAssertNotEqual(timezone1, timezone2)
|
||
4 years ago
|
}
|
||
6 years ago
|
}
|