[Enhancement] Optional+Nil extension #17
@ -4,7 +4,7 @@ public extension TimeZone {
|
||||
|
||||
// MARK: Zones
|
||||
|
||||
/// Greenwich Mean Time or UTC+0
|
||||
/// A time zone indicating it is Greenwich Mean Time or UTC+0
|
||||
static let gmt = TimeZone(secondsFromGMT: 0)
|
||||
|
||||
}
|
||||
|
34
Tests/Core/Cases/Extensions/TimeZone+ZoneTests.swift
Normal file
34
Tests/Core/Cases/Extensions/TimeZone+ZoneTests.swift
Normal file
@ -0,0 +1,34 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This source file is part of the SwiftLibs open source project
|
||||
//
|
||||
// Copyright (c) 2023 Röck+Cöde VoF. and the SwiftLibs project authors
|
||||
// Licensed under the EUPL 1.2 or later.
|
||||
//
|
||||
// See LICENSE.txt for license information
|
||||
// See CONTRIBUTORS.txt for the list of SwiftLibs project authors
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Core
|
||||
import XCTest
|
||||
|
||||
final class TimeZone_ZoneTests: XCTestCase {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
private var timeZone: TimeZone!
|
||||
|
||||
// MARK: Tests
|
||||
|
||||
func test_gmt() {
|
||||
// GIVEN
|
||||
// WHEN
|
||||
timeZone = .gmt
|
||||
|
||||
// THEN
|
||||
XCTAssertEqual(timeZone.identifier, "GMT")
|
||||
XCTAssertEqual(timeZone.secondsFromGMT(), 0)
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user