diff --git a/novawalletTests/Mocks/ModuleMocks.swift b/novawalletTests/Mocks/ModuleMocks.swift index a6e009862..30a8b8651 100644 --- a/novawalletTests/Mocks/ModuleMocks.swift +++ b/novawalletTests/Mocks/ModuleMocks.swift @@ -4171,6 +4171,99 @@ import Foundation import Operation_iOS + class MockDAppBrowserTransitionProtocol: DAppBrowserTransitionProtocol, Cuckoo.ProtocolMock { + + typealias MocksType = DAppBrowserTransitionProtocol + + typealias Stubbing = __StubbingProxy_DAppBrowserTransitionProtocol + typealias Verification = __VerificationProxy_DAppBrowserTransitionProtocol + + let cuckoo_manager = Cuckoo.MockManager.preconfiguredManager ?? Cuckoo.MockManager(hasParent: false) + + + private var __defaultImplStub: DAppBrowserTransitionProtocol? + + func enableDefaultImplementation(_ stub: DAppBrowserTransitionProtocol) { + __defaultImplStub = stub + cuckoo_manager.enableDefaultStubImplementation() + } + + + + + + + + + + func idForTransitioningTab() -> UUID? { + + return cuckoo_manager.call("idForTransitioningTab() -> UUID?", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.idForTransitioningTab()) + + } + + + struct __StubbingProxy_DAppBrowserTransitionProtocol: Cuckoo.StubbingProxy { + private let cuckoo_manager: Cuckoo.MockManager + + init(manager: Cuckoo.MockManager) { + self.cuckoo_manager = manager + } + + + func idForTransitioningTab() -> Cuckoo.ProtocolStubFunction<(), UUID?> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserTransitionProtocol.self, method: "idForTransitioningTab() -> UUID?", parameterMatchers: matchers)) + } + + } + + struct __VerificationProxy_DAppBrowserTransitionProtocol: Cuckoo.VerificationProxy { + private let cuckoo_manager: Cuckoo.MockManager + private let callMatcher: Cuckoo.CallMatcher + private let sourceLocation: Cuckoo.SourceLocation + + init(manager: Cuckoo.MockManager, callMatcher: Cuckoo.CallMatcher, sourceLocation: Cuckoo.SourceLocation) { + self.cuckoo_manager = manager + self.callMatcher = callMatcher + self.sourceLocation = sourceLocation + } + + + + + @discardableResult + func idForTransitioningTab() -> Cuckoo.__DoNotUse<(), UUID?> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("idForTransitioningTab() -> UUID?", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + } +} + + class DAppBrowserTransitionProtocolStub: DAppBrowserTransitionProtocol { + + + + + + + + func idForTransitioningTab() -> UUID? { + return DefaultValueRegistry.defaultValue(for: (UUID?).self) + } + +} + + + class MockDAppBrowserViewProtocol: DAppBrowserViewProtocol, Cuckoo.ProtocolMock { typealias MocksType = DAppBrowserViewProtocol @@ -4342,6 +4435,36 @@ import Operation_iOS } + + + func didReceiveRenderRequest() { + + return cuckoo_manager.call("didReceiveRenderRequest()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveRenderRequest()) + + } + + + + func idForTransitioningTab() -> UUID? { + + return cuckoo_manager.call("idForTransitioningTab() -> UUID?", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.idForTransitioningTab()) + + } + struct __StubbingProxy_DAppBrowserViewProtocol: Cuckoo.StubbingProxy { private let cuckoo_manager: Cuckoo.MockManager @@ -4401,6 +4524,16 @@ import Operation_iOS return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didDecideClose()", parameterMatchers: matchers)) } + func didReceiveRenderRequest() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "didReceiveRenderRequest()", parameterMatchers: matchers)) + } + + func idForTransitioningTab() -> Cuckoo.ProtocolStubFunction<(), UUID?> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserViewProtocol.self, method: "idForTransitioningTab() -> UUID?", parameterMatchers: matchers)) + } + } struct __VerificationProxy_DAppBrowserViewProtocol: Cuckoo.VerificationProxy { @@ -4475,6 +4608,18 @@ import Operation_iOS return cuckoo_manager.verify("didDecideClose()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didReceiveRenderRequest() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didReceiveRenderRequest()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + + @discardableResult + func idForTransitioningTab() -> Cuckoo.__DoNotUse<(), UUID?> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("idForTransitioningTab() -> UUID?", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + } } @@ -4550,6 +4695,18 @@ import Operation_iOS return DefaultValueRegistry.defaultValue(for: (Void).self) } + + + func didReceiveRenderRequest() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + + func idForTransitioningTab() -> UUID? { + return DefaultValueRegistry.defaultValue(for: (UUID?).self) + } + } @@ -5555,6 +5712,21 @@ import Operation_iOS + func didReceiveRenderRequest() { + + return cuckoo_manager.call("didReceiveRenderRequest()", + parameters: (), + escapingParameters: (), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.didReceiveRenderRequest()) + + } + + + func didSaveLastTabState() { return cuckoo_manager.call("didSaveLastTabState()", @@ -5627,6 +5799,11 @@ import Operation_iOS return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didChangeGlobal(settings: DAppGlobalSettings)", parameterMatchers: matchers)) } + func didReceiveRenderRequest() -> Cuckoo.ProtocolStubNoReturnFunction<()> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didReceiveRenderRequest()", parameterMatchers: matchers)) + } + func didSaveLastTabState() -> Cuckoo.ProtocolStubNoReturnFunction<()> { let matchers: [Cuckoo.ParameterMatcher] = [] return .init(stub: cuckoo_manager.createStub(for: MockDAppBrowserInteractorOutputProtocol.self, method: "didSaveLastTabState()", parameterMatchers: matchers)) @@ -5708,6 +5885,12 @@ import Operation_iOS return cuckoo_manager.verify("didChangeGlobal(settings: DAppGlobalSettings)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func didReceiveRenderRequest() -> Cuckoo.__DoNotUse<(), Void> { + let matchers: [Cuckoo.ParameterMatcher] = [] + return cuckoo_manager.verify("didReceiveRenderRequest()", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + @discardableResult func didSaveLastTabState() -> Cuckoo.__DoNotUse<(), Void> { let matchers: [Cuckoo.ParameterMatcher] = [] @@ -5785,6 +5968,12 @@ import Operation_iOS + func didReceiveRenderRequest() { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + func didSaveLastTabState() { return DefaultValueRegistry.defaultValue(for: (Void).self) } @@ -6992,6 +7181,21 @@ import SubstrateSdk + func showFavorites(from view: DAppListViewProtocol?) { + + return cuckoo_manager.call("showFavorites(from: DAppListViewProtocol?)", + parameters: (view), + escapingParameters: (view), + superclassCall: + + Cuckoo.MockManager.crashOnProtocolSuperclassCall() + , + defaultCall: __defaultImplStub!.showFavorites(from: view)) + + } + + + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { return cuckoo_manager.call("showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", @@ -7039,6 +7243,11 @@ import SubstrateSdk return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showSetting(from: DAppListViewProtocol?)", parameterMatchers: matchers)) } + func showFavorites(from view: M1) -> Cuckoo.ProtocolStubNoReturnFunction<(DAppListViewProtocol?)> where M1.OptionalMatchedType == DAppListViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showFavorites(from: DAppListViewProtocol?)", parameterMatchers: matchers)) + } + func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.ProtocolStubNoReturnFunction<(URL, ControllerBackedProtocol, WebPresentableStyle)> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] return .init(stub: cuckoo_manager.createStub(for: MockDAppListWireframeProtocol.self, method: "showWeb(url: URL, from: ControllerBackedProtocol, style: WebPresentableStyle)", parameterMatchers: matchers)) @@ -7076,6 +7285,12 @@ import SubstrateSdk return cuckoo_manager.verify("showSetting(from: DAppListViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) } + @discardableResult + func showFavorites(from view: M1) -> Cuckoo.__DoNotUse<(DAppListViewProtocol?), Void> where M1.OptionalMatchedType == DAppListViewProtocol { + let matchers: [Cuckoo.ParameterMatcher<(DAppListViewProtocol?)>] = [wrap(matchable: view) { $0 }] + return cuckoo_manager.verify("showFavorites(from: DAppListViewProtocol?)", callMatcher: callMatcher, parameterMatchers: matchers, sourceLocation: sourceLocation) + } + @discardableResult func showWeb(url: M1, from view: M2, style: M3) -> Cuckoo.__DoNotUse<(URL, ControllerBackedProtocol, WebPresentableStyle), Void> where M1.MatchedType == URL, M2.MatchedType == ControllerBackedProtocol, M3.MatchedType == WebPresentableStyle { let matchers: [Cuckoo.ParameterMatcher<(URL, ControllerBackedProtocol, WebPresentableStyle)>] = [wrap(matchable: url) { $0.0 }, wrap(matchable: view) { $0.1 }, wrap(matchable: style) { $0.2 }] @@ -7114,6 +7329,12 @@ import SubstrateSdk + func showFavorites(from view: DAppListViewProtocol?) { + return DefaultValueRegistry.defaultValue(for: (Void).self) + } + + + func showWeb(url: URL, from view: ControllerBackedProtocol, style: WebPresentableStyle) { return DefaultValueRegistry.defaultValue(for: (Void).self) } diff --git a/novawalletTests/Modules/DApps/DAppBrowser/DAppBrowserTests.swift b/novawalletTests/Modules/DApps/DAppBrowser/DAppBrowserTests.swift index b61d6e514..97f86bda8 100644 --- a/novawalletTests/Modules/DApps/DAppBrowser/DAppBrowserTests.swift +++ b/novawalletTests/Modules/DApps/DAppBrowser/DAppBrowserTests.swift @@ -81,6 +81,7 @@ class DAppBrowserTests: XCTestCase { operationQueue: OperationQueue(), sequentialPhishingVerifier: phishingVerifier, tabManager: tabManager, + applicationHandler: ApplicationHandler(), logger: Logger.shared )