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

Add E2EGetId functor

parent 9f4d96bf
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
import Bindings
public struct E2E {
public var getId: E2EGetId
// TODO:
}
extension E2E {
public static func live(_ bindingsE2E: BindingsE2e) -> E2E {
E2E()
E2E(
getId: .live(bindingsE2E: bindingsE2E)
)
}
}
extension E2E {
public static let unimplemented = E2E()
public static let unimplemented = E2E(
getId: .unimplemented
)
}
import Bindings
import XCTestDynamicOverlay
public struct E2EGetId {
public var run: () -> Int
public func callAsFunction() -> Int {
run()
}
}
extension E2EGetId {
public static func live(bindingsE2E: BindingsE2e) -> E2EGetId {
E2EGetId(run: bindingsE2E.getID)
}
}
extension E2EGetId {
public static let unimplemented = E2EGetId(
run: XCTUnimplemented("\(Self.self)")
)
}
import Bindings
public struct ClientE2EIdProvider {
public var get: () -> Int
public func callAsFunction() -> Int {
get()
}
}
extension ClientE2EIdProvider {
public static func live(bindingsClientE2E: BindingsE2e) -> ClientE2EIdProvider {
ClientE2EIdProvider(get: bindingsClientE2E.getID)
}
}
#if DEBUG
extension ClientE2EIdProvider {
public static let failing = ClientE2EIdProvider {
fatalError("Not implemented")
}
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment