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

Add CmixGetId functor

parent 4b4bddbc
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
import Bindings
public struct Cmix {
public var getId: CmixGetId
public var makeReceptionIdentity: MakeReceptionIdentity
}
extension Cmix {
public static func live(_ bindingsCmix: BindingsCmix) -> Cmix {
Cmix(
getId: .live(bindingsCmix),
makeReceptionIdentity: .live(bindingsCmix)
)
}
......@@ -14,6 +16,7 @@ extension Cmix {
extension Cmix {
public static let unimplemented = Cmix(
getId: .unimplemented,
makeReceptionIdentity: .unimplemented
)
}
import Bindings
import XCTestDynamicOverlay
public struct CmixGetId {
public var run: () -> Int
public func callAsFunction() -> Int {
run()
}
}
extension CmixGetId {
public static func live(_ bindingsCmix: BindingsCmix) -> CmixGetId {
CmixGetId(run: bindingsCmix.getID)
}
}
extension CmixGetId {
public static let unimplemented = CmixGetId(
run: XCTUnimplemented("\(Self.self)")
)
}
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