Skip to content
Snippets Groups Projects
DateTests.swift 550 B
Newer Older
Bruno Muniz's avatar
Bruno Muniz committed
import XCTest

@testable import Shared

final class DateTests: XCTestCase {
    var sut: Date!

    override func setUp() {
        sut = DateFormatter.nonUS.date(from: "1/06/1995 07:00:00")!
    }

    func test_MonthDayFormat() {
        XCTAssertEqual(DateFormatter.monthDay.string(from: sut), "June 1")
    }

    func test_shortTimeFormat() {
        XCTAssertEqual(DateFormatter.shortTime.string(from: sut), "7:00 AM")
    }

    func test_shortDateFormat() {
        XCTAssertEqual(DateFormatter.shortDate.string(from: sut), "6/1/95")
    }
}