-
-
Notifications
You must be signed in to change notification settings - Fork 770
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TimePeriodChain extremes after initialization
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// SwiftDate | ||
// Parse, validate, manipulate, and display dates, time and timezones in Swift | ||
// | ||
// Created by AsioOtus | ||
// - Mail: asio.otus.verus@icloud.com | ||
// | ||
// Copyright © 2019 Daniele Margutti. Licensed under MIT License. | ||
// | ||
|
||
import SwiftDate | ||
import XCTest | ||
|
||
class TestTimePeriodChain: XCTestCase { | ||
let periods = [ | ||
TimePeriod(start: .init(year: 2020, month: 2, day: 1), end: .init(year: 2020, month: 2, day: 28)), | ||
TimePeriod(start: .init(year: 2020, month: 3, day: 1), end: .init(year: 2020, month: 3, day: 31)), | ||
TimePeriod(start: .init(year: 2020, month: 4, day: 1), end: .init(year: 2020, month: 4, day: 30)), | ||
TimePeriod(start: .init(year: 2020, month: 5, day: 1), end: .init(year: 2020, month: 5, day: 31)) | ||
] | ||
|
||
func testInitialExtremes () { | ||
let chain = TimePeriodChain(periods) | ||
|
||
XCTAssert(chain.start == periods.first!.start, "TimePeriodChain initial start not equals to source period start") | ||
XCTAssert(chain.end == periods.last!.end, "TimePeriodChain initial end not equals to source period end") | ||
} | ||
|
||
} |