Skip to content

Commit 728b364

Browse files
committed
TestFoundation: TestDateInterval: Update test names to reflect proper Swift terms
1 parent aebd254 commit 728b364

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

TestFoundation/TestDateInterval.swift

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
class TestDateInterval: XCTestCase {
1111
static var allTests: [(String, (TestDateInterval) -> () throws -> Void)] {
1212
return [
13-
("test_defaultConstructor", test_defaultConstructor),
14-
("test_startEndConstructor", test_startEndConstructor),
15-
("test_startDurationConstructor", test_startDurationConstructor),
13+
("test_defaultInitializer", test_defaultInitializer),
14+
("test_startEndInitializer", test_startEndInitializer),
15+
("test_startDurationInitializer", test_startDurationInitializer),
1616
("test_compareDifferentStarts", test_compareDifferentStarts),
1717
("test_compareDifferentDurations", test_compareDifferentDurations),
1818
("test_compareSame", test_compareSame),
@@ -26,19 +26,19 @@ class TestDateInterval: XCTestCase {
2626
]
2727
}
2828

29-
func test_defaultConstructor() {
29+
func test_defaultInitializer() {
3030
let dateInterval = DateInterval()
3131
XCTAssertEqual(dateInterval.duration, 0)
3232
}
33-
34-
func test_startEndConstructor() {
33+
34+
func test_startEndInitializer() {
3535
let date1 = dateWithString("2019-04-04 17:09:23 -0700")
3636
let date2 = dateWithString("2019-04-04 18:09:23 -0700")
3737
let dateInterval = DateInterval(start: date1, end: date2)
3838
XCTAssertEqual(dateInterval.duration, 60 * 60)
3939
}
4040

41-
func test_startDurationConstructor() {
41+
func test_startDurationInitializer() {
4242
let date = dateWithString("2019-04-04 17:09:23 -0700")
4343
let dateInterval = DateInterval(start: date, duration: 60)
4444
XCTAssertEqual(dateInterval.duration, 60)
@@ -52,7 +52,7 @@ class TestDateInterval: XCTestCase {
5252
XCTAssertEqual(dateInterval1.compare(dateInterval2), .orderedAscending)
5353
XCTAssertEqual(dateInterval2.compare(dateInterval1), .orderedDescending)
5454
}
55-
55+
5656
func test_compareDifferentDurations() {
5757
let date = dateWithString("2019-04-04 17:09:23 -0700")
5858
let dateInterval1 = DateInterval(start: date, duration: 60)
@@ -68,7 +68,7 @@ class TestDateInterval: XCTestCase {
6868
XCTAssertEqual(dateInterval1.compare(dateInterval2), .orderedSame)
6969
XCTAssertEqual(dateInterval2.compare(dateInterval1), .orderedSame)
7070
}
71-
71+
7272
func test_comparisonOperators() {
7373
let date1 = dateWithString("2019-04-04 17:00:00 -0700")
7474
let date2 = dateWithString("2019-04-04 17:30:00 -0700")
@@ -88,7 +88,7 @@ class TestDateInterval: XCTestCase {
8888
let dateInterval2 = DateInterval(start: date2, duration: 15)
8989
XCTAssertTrue(dateInterval1.intersects(dateInterval2))
9090
}
91-
91+
9292
func test_intersection() {
9393
let date1 = dateWithString("2019-04-04 17:00:00 -0700")
9494
let date2 = dateWithString("2019-04-04 17:15:00 -0700")
@@ -108,15 +108,15 @@ class TestDateInterval: XCTestCase {
108108
XCTAssertNotNil(intersection)
109109
XCTAssertEqual(intersection!.duration, 0)
110110
}
111-
111+
112112
func test_intersectionNil() {
113113
let date1 = dateWithString("2019-04-04 17:00:00 -0700")
114114
let date2 = dateWithString("2019-04-04 17:30:01 -0700")
115115
let dateInterval1 = DateInterval(start: date1, duration: 60 * 30)
116116
let dateInterval2 = DateInterval(start: date2, duration: 60 * 30)
117117
XCTAssertNil(dateInterval1.intersection(with: dateInterval2))
118118
}
119-
119+
120120
func test_contains() {
121121
let date1 = dateWithString("2019-04-04 17:00:00 -0700")
122122
let date2 = dateWithString("2019-04-04 17:30:00 -0700")
@@ -127,7 +127,7 @@ class TestDateInterval: XCTestCase {
127127
XCTAssertTrue(dateInterval.contains(date3))
128128
XCTAssertFalse(dateInterval.contains(date4))
129129
}
130-
130+
131131
func test_hashing() {
132132
guard #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) else { return }
133133

0 commit comments

Comments
 (0)