-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from IdeasOnCanvas/enhancement/relaxDateParsing
Relax date parsing
- Loading branch information
Showing
6 changed files
with
92 additions
and
15 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
AppReceiptValidator/AppReceiptValidator Tests Shared/ReceiptDateFormatterTests.swift
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,28 @@ | ||
// | ||
// ReceiptDateFormatterTests.swift | ||
// AppReceiptValidator | ||
// | ||
// Created by Hannes Oud on 09.10.20. | ||
// Copyright © 2020 IdeasOnCanvas GmbH. All rights reserved. | ||
// | ||
|
||
import AppReceiptValidator | ||
import Foundation | ||
import XCTest | ||
|
||
|
||
final class ReceiptDateFormatterTests: XCTestCase { | ||
|
||
func testDateFormatting() throws { | ||
let dateStrings = [ | ||
"2020-01-01T12:00:00Z", | ||
"2020-01-01T12:00:00.123Z", | ||
"2020-01-01T12:00:00.999Z", | ||
"2020-01-01T12:00:01Z" | ||
] | ||
for dateString in dateStrings { | ||
let parsed = try XCTUnwrap(AppReceiptValidator.ReceiptDateFormatter.date(from: dateString)) | ||
XCTAssertEqual(AppReceiptValidator.ReceiptDateFormatter.string(from: parsed), dateString) | ||
} | ||
} | ||
} |
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
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