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
This commit is part of merge request !18. Comments created here will be created in the context of that merge request.
import Bindings import Bindings
public struct Cmix { public struct Cmix {
public var getId: CmixGetId
public var makeReceptionIdentity: MakeReceptionIdentity public var makeReceptionIdentity: MakeReceptionIdentity
} }
extension Cmix { extension Cmix {
public static func live(_ bindingsCmix: BindingsCmix) -> Cmix { public static func live(_ bindingsCmix: BindingsCmix) -> Cmix {
Cmix( Cmix(
getId: .live(bindingsCmix),
makeReceptionIdentity: .live(bindingsCmix) makeReceptionIdentity: .live(bindingsCmix)
) )
} }
...@@ -14,6 +16,7 @@ extension Cmix { ...@@ -14,6 +16,7 @@ extension Cmix {
extension Cmix { extension Cmix {
public static let unimplemented = Cmix( public static let unimplemented = Cmix(
getId: .unimplemented,
makeReceptionIdentity: .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.
Please register or to comment