Skip to content
Snippets Groups Projects
Commit f99331c7 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Remove failing constructors

parent 8ccac1c0
No related branches found
No related tags found
2 merge requests!32Replace failing constructors with unimplemented constructors,!30Release v1.2.0
...@@ -73,8 +73,6 @@ extension Migrator { ...@@ -73,8 +73,6 @@ extension Migrator {
import XCTestDynamicOverlay import XCTestDynamicOverlay
extension Migrator { extension Migrator {
public static let failing = Migrator { _, _, _, _ in fatalError() }
public static let unimplemented = Migrator( public static let unimplemented = Migrator(
run: XCTUnimplemented("\(Self.self)") run: XCTUnimplemented("\(Self.self)")
) )
......
...@@ -177,39 +177,6 @@ public struct Database { ...@@ -177,39 +177,6 @@ public struct Database {
#if DEBUG #if DEBUG
extension Database { extension Database {
static public let failing = Database(
fetchChatInfos: .failing(),
fetchChatInfosPublisher: .failing(),
fetchContacts: .failing(),
fetchContactsPublisher: .failing(),
saveContact: .failing(),
bulkUpdateContacts: .failing(),
deleteContact: .failing(),
fetchContactChatInfos: .failing(),
fetchContactChatInfosPublisher: .failing(),
fetchGroups: .failing(),
fetchGroupsPublisher: .failing(),
saveGroup: .failing(),
deleteGroup: .failing(),
fetchGroupChatInfos: .failing(),
fetchGroupChatInfosPublisher: .failing(),
fetchGroupInfos: .failing(),
fetchGroupInfosPublisher: .failing(),
saveGroupMember: .failing(),
deleteGroupMember: .failing(),
fetchMessages: .failing(),
fetchMessagesPublisher: .failing(),
saveMessage: .failing(),
bulkUpdateMessages: .failing(),
deleteMessage: .failing(),
deleteMessages: .failing(),
fetchFileTransfers: .failing(),
fetchFileTransfersPublisher: .failing(),
saveFileTransfer: .failing(),
deleteFileTransfer: .failing(),
drop: .failing
)
static public let unimplemented = Database( static public let unimplemented = Database(
fetchChatInfos: .unimplemented(), fetchChatInfos: .unimplemented(),
fetchChatInfosPublisher: .unimplemented(), fetchChatInfosPublisher: .unimplemented(),
......
...@@ -25,10 +25,6 @@ public struct BulkUpdate<Query, Assignments> { ...@@ -25,10 +25,6 @@ public struct BulkUpdate<Query, Assignments> {
import XCTestDynamicOverlay import XCTestDynamicOverlay
extension BulkUpdate { extension BulkUpdate {
public static func failing<Query, Assignments>() -> BulkUpdate<Query, Assignments> {
BulkUpdate<Query, Assignments> { _, _ in fatalError() }
}
public static func unimplemented<Query, Assignments>() -> BulkUpdate<Query, Assignments> { public static func unimplemented<Query, Assignments>() -> BulkUpdate<Query, Assignments> {
BulkUpdate<Query, Assignments>(run: XCTUnimplemented("\(Self.self)")) BulkUpdate<Query, Assignments>(run: XCTUnimplemented("\(Self.self)"))
} }
......
...@@ -25,10 +25,6 @@ public struct Delete<Model> { ...@@ -25,10 +25,6 @@ public struct Delete<Model> {
import XCTestDynamicOverlay import XCTestDynamicOverlay
extension Delete { extension Delete {
public static func failing<Model>() -> Delete<Model> {
Delete<Model> { _ in fatalError() }
}
public static func unimplemented<Model>() -> Delete<Model> { public static func unimplemented<Model>() -> Delete<Model> {
Delete<Model>(run: XCTUnimplemented("\(Self.self)")) Delete<Model>(run: XCTUnimplemented("\(Self.self)"))
} }
......
...@@ -24,10 +24,6 @@ public struct DeleteMany<Model, Query> { ...@@ -24,10 +24,6 @@ public struct DeleteMany<Model, Query> {
import XCTestDynamicOverlay import XCTestDynamicOverlay
extension DeleteMany { extension DeleteMany {
public static func failing<Model, Query>() -> DeleteMany<Model, Query> {
DeleteMany<Model, Query> { _ in fatalError() }
}
public static func unimplemented<Model>() -> DeleteMany<Model, Query> { public static func unimplemented<Model>() -> DeleteMany<Model, Query> {
DeleteMany<Model, Query>(run: XCTUnimplemented("\(Self.self)")) DeleteMany<Model, Query>(run: XCTUnimplemented("\(Self.self)"))
} }
......
...@@ -23,7 +23,6 @@ public struct Drop { ...@@ -23,7 +23,6 @@ public struct Drop {
import XCTestDynamicOverlay import XCTestDynamicOverlay
extension Drop { extension Drop {
public static let failing = Drop { fatalError() }
public static let unimplemented = Drop(run: XCTUnimplemented("\(Self.self)")) public static let unimplemented = Drop(run: XCTUnimplemented("\(Self.self)"))
} }
#endif #endif
...@@ -25,10 +25,6 @@ public struct Fetch<Model, Query> { ...@@ -25,10 +25,6 @@ public struct Fetch<Model, Query> {
import XCTestDynamicOverlay import XCTestDynamicOverlay
extension Fetch { extension Fetch {
public static func failing<Model, Query>() -> Fetch<Model, Query> {
Fetch<Model, Query> { _ in fatalError() }
}
public static func unimplemented<Model, Query>() -> Fetch<Model, Query> { public static func unimplemented<Model, Query>() -> Fetch<Model, Query> {
Fetch<Model, Query>(run: XCTUnimplemented("\(Self.self)")) Fetch<Model, Query>(run: XCTUnimplemented("\(Self.self)"))
} }
......
...@@ -26,10 +26,6 @@ public struct FetchPublisher<Model, Query> { ...@@ -26,10 +26,6 @@ public struct FetchPublisher<Model, Query> {
import XCTestDynamicOverlay import XCTestDynamicOverlay
extension FetchPublisher { extension FetchPublisher {
public static func failing<Model, Query>() -> FetchPublisher<Model, Query> {
FetchPublisher<Model, Query> { _ in fatalError() }
}
public static func unimplemented<Model, Query>() -> FetchPublisher<Model, Query> { public static func unimplemented<Model, Query>() -> FetchPublisher<Model, Query> {
FetchPublisher<Model, Query>( FetchPublisher<Model, Query>(
run: XCTUnimplemented("\(Self.self)", placeholder: Empty().eraseToAnyPublisher()) run: XCTUnimplemented("\(Self.self)", placeholder: Empty().eraseToAnyPublisher())
......
...@@ -28,10 +28,6 @@ public struct Save<Model> { ...@@ -28,10 +28,6 @@ public struct Save<Model> {
import XCTestDynamicOverlay import XCTestDynamicOverlay
extension Save { extension Save {
public static func failing<Model>() -> Save<Model> {
Save<Model> { _ in fatalError() }
}
public static func unimplemented<Model>() -> Save<Model> { public static func unimplemented<Model>() -> Save<Model> {
Save<Model>(run: XCTUnimplemented("\(Self.self)")) Save<Model>(run: XCTUnimplemented("\(Self.self)"))
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment