-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61220ff
commit e3a1ccb
Showing
3 changed files
with
56 additions
and
130 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Utils.swift | ||
// ProcessOut | ||
// | ||
// Created by Andrii Vysotskyi on 07.07.2023. | ||
// | ||
|
||
import XCTest | ||
|
||
/// Asserts that an expression throws an error. | ||
/// - Parameters: | ||
/// - expression: An expression that can throw an error. | ||
/// - message: An optional description of a failure. | ||
/// - errorHandler: An optional handler for errors that expression throws. | ||
func assertThrowsError<T>( | ||
_ expression: @autoclosure () async throws -> T, | ||
_ message: @autoclosure () -> String = "", | ||
file: StaticString = #filePath, | ||
line: UInt = #line, | ||
_ errorHandler: (_ error: Error) -> Void = { _ in } | ||
) async { | ||
do { | ||
_ = try await expression() | ||
} catch { | ||
errorHandler(error) | ||
return | ||
} | ||
XCTFail(message(), file: file, line: line) | ||
} |
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
129 changes: 0 additions & 129 deletions
129
Tests/ProcessOutTests/Sources/Unit/Repositories/Cards/HttpCardsRepositoryTests.swift
This file was deleted.
Oops, something went wrong.