-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip to add typeMap when the type may have globalActor
- Loading branch information
1 parent
02f1109
commit 21d65e9
Showing
7 changed files
with
87 additions
and
9 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
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
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
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
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
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
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,45 @@ | ||
import MockoloFramework | ||
|
||
let globalActorProtocol = """ | ||
/// \(String.mockAnnotation) | ||
@MainActor protocol RootController: AnyObject { | ||
var viewController: UIViewController { get } | ||
} | ||
/// \(String.mockAnnotation) | ||
protocol RootBuildable { | ||
func build() -> RootController | ||
} | ||
""" | ||
|
||
let globalActorProtocolMock = """ | ||
class RootControllerMock: RootController { | ||
init() { } | ||
init(viewController: UIViewController) { | ||
self._viewController = viewController | ||
} | ||
private var _viewController: UIViewController! | ||
var viewController: UIViewController { | ||
get { return _viewController } | ||
set { _viewController = newValue } | ||
} | ||
} | ||
class RootBuildableMock: RootBuildable { | ||
init() { } | ||
private(set) var buildCallCount = 0 | ||
var buildHandler: (() -> (RootController))? | ||
func build() -> RootController { | ||
buildCallCount += 1 | ||
if let buildHandler = buildHandler { | ||
return buildHandler() | ||
} | ||
fatalError("buildHandler returns can't have a default value thus its handler must be set") | ||
} | ||
} | ||
""" |