How to use failTest method of StubbingContext class

Best Mockingbird code snippet using StubbingContext.failTest

SwiftUIAppTests-SwiftUIAppMocks.generated.swift

Source:SwiftUIAppTests-SwiftUIAppMocks.generated.swift Github

copy

Full Screen

...39 return concreteImplementation()40 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (NSPersistentContainer).self) {41 return defaultValue42 } else {43 fatalError(stubbingContext.failTest(for: invocation))44 }45 }46 }47 set {48 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "persistentContainer.set", arguments: [ArgumentMatcher(newValue)])49 mockingContext.didInvoke(invocation)50 let implementation = stubbingContext.implementation(for: invocation)51 if let concreteImplementation = implementation as? (NSPersistentContainer) -> Void {52 concreteImplementation(newValue)53 } else {54 (implementation as? () -> Void)?()55 }56 }57 }58 public func getPersistentContainer() -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> NSPersistentContainer, NSPersistentContainer> {59 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "persistentContainer.get", arguments: [])60 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> NSPersistentContainer, NSPersistentContainer>(mock: self, invocation: invocation)61 }62 public func setPersistentContainer(_ newValue: @escaping @autoclosure () -> NSPersistentContainer) -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, (NSPersistentContainer) -> Void, Void> {63 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]64 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "persistentContainer.set", arguments: arguments)65 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, (NSPersistentContainer) -> Void, Void>(mock: self, invocation: invocation)66 }67 // MARK: Mocked `application`(_ `application`: UIApplication, `configurationForConnecting` `connectingSceneSession`: UISceneSession, `options`: UIScene.ConnectionOptions)68 public override func `application`(_ `application`: UIApplication, `configurationForConnecting` `connectingSceneSession`: UISceneSession, `options`: UIScene.ConnectionOptions) -> UISceneConfiguration {69 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`application`(_ `application`: UIApplication, `configurationForConnecting` `connectingSceneSession`: UISceneSession, `options`: UIScene.ConnectionOptions) -> UISceneConfiguration", arguments: [Mockingbird.ArgumentMatcher(`application`), Mockingbird.ArgumentMatcher(`connectingSceneSession`), Mockingbird.ArgumentMatcher(`options`)])70 return mockingContext.didInvoke(invocation) { () -> UISceneConfiguration in71 let implementation = stubbingContext.implementation(for: invocation)72 if let concreteImplementation = implementation as? (UIApplication, UISceneSession, UIScene.ConnectionOptions) -> UISceneConfiguration {73 return concreteImplementation(`application`, `connectingSceneSession`, `options`)74 } else if let concreteImplementation = implementation as? () -> UISceneConfiguration {75 return concreteImplementation()76 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (UISceneConfiguration).self) {77 return defaultValue78 } else {79 fatalError(stubbingContext.failTest(for: invocation))80 }81 }82 }83 public func `application`(_ `application`: @escaping @autoclosure () -> UIApplication, `configurationForConnecting` `connectingSceneSession`: @escaping @autoclosure () -> UISceneSession, `options`: @escaping @autoclosure () -> UIScene.ConnectionOptions) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIApplication, UISceneSession, UIScene.ConnectionOptions) -> UISceneConfiguration, UISceneConfiguration> {84 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`application`), Mockingbird.resolve(`connectingSceneSession`), Mockingbird.resolve(`options`)]85 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`application`(_ `application`: UIApplication, `configurationForConnecting` `connectingSceneSession`: UISceneSession, `options`: UIScene.ConnectionOptions) -> UISceneConfiguration", arguments: arguments)86 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIApplication, UISceneSession, UIScene.ConnectionOptions) -> UISceneConfiguration, UISceneConfiguration>(mock: self, invocation: invocation)87 }88 // MARK: Mocked `application`(_ `application`: UIApplication, `didDiscardSceneSessions` `sceneSessions`: Set<UISceneSession>)89 public override func `application`(_ `application`: UIApplication, `didDiscardSceneSessions` `sceneSessions`: Set<UISceneSession>) -> Void {90 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`application`(_ `application`: UIApplication, `didDiscardSceneSessions` `sceneSessions`: Set<UISceneSession>) -> Void", arguments: [Mockingbird.ArgumentMatcher(`application`), Mockingbird.ArgumentMatcher(`sceneSessions`)])91 mockingContext.didInvoke(invocation) { () -> Void in92 let implementation = stubbingContext.implementation(for: invocation)93 if let concreteImplementation = implementation as? (UIApplication, Set<UISceneSession>) -> Void {94 concreteImplementation(`application`, `sceneSessions`)95 } else if let concreteImplementation = implementation as? () -> Void {96 concreteImplementation()97 }98 }99 }100 public func `application`(_ `application`: @escaping @autoclosure () -> UIApplication, `didDiscardSceneSessions` `sceneSessions`: @escaping @autoclosure () -> Set<UISceneSession>) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIApplication, Set<UISceneSession>) -> Void, Void> {101 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`application`), Mockingbird.resolve(`sceneSessions`)]102 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`application`(_ `application`: UIApplication, `didDiscardSceneSessions` `sceneSessions`: Set<UISceneSession>) -> Void", arguments: arguments)103 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIApplication, Set<UISceneSession>) -> Void, Void>(mock: self, invocation: invocation)104 }105 // MARK: Mocked `application`(_ `application`: UIApplication, `didFinishLaunchingWithOptions` `launchOptions`: [UIApplication.LaunchOptionsKey: Any]?)106 public override func `application`(_ `application`: UIApplication, `didFinishLaunchingWithOptions` `launchOptions`: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {107 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`application`(_ `application`: UIApplication, `didFinishLaunchingWithOptions` `launchOptions`: [UIApplication.LaunchOptionsKey: Any]?) -> Bool", arguments: [Mockingbird.ArgumentMatcher(`application`), Mockingbird.ArgumentMatcher(`launchOptions`)])108 return mockingContext.didInvoke(invocation) { () -> Bool in109 let implementation = stubbingContext.implementation(for: invocation)110 if let concreteImplementation = implementation as? (UIApplication, [UIApplication.LaunchOptionsKey: Any]?) -> Bool {111 return concreteImplementation(`application`, `launchOptions`)112 } else if let concreteImplementation = implementation as? () -> Bool {113 return concreteImplementation()114 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (Bool).self) {115 return defaultValue116 } else {117 fatalError(stubbingContext.failTest(for: invocation))118 }119 }120 }121 public func `application`(_ `application`: @escaping @autoclosure () -> UIApplication, `didFinishLaunchingWithOptions` `launchOptions`: @escaping @autoclosure () -> [UIApplication.LaunchOptionsKey: Any]?) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIApplication, [UIApplication.LaunchOptionsKey: Any]?) -> Bool, Bool> {122 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`application`), Mockingbird.resolve(`launchOptions`)]123 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`application`(_ `application`: UIApplication, `didFinishLaunchingWithOptions` `launchOptions`: [UIApplication.LaunchOptionsKey: Any]?) -> Bool", arguments: arguments)124 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIApplication, [UIApplication.LaunchOptionsKey: Any]?) -> Bool, Bool>(mock: self, invocation: invocation)125 }126 // MARK: Mocked `saveContext`()127 public override func `saveContext`() -> Void {128 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`saveContext`() -> Void", arguments: [])129 mockingContext.didInvoke(invocation) { () -> Void in130 let implementation = stubbingContext.implementation(for: invocation)131 if let concreteImplementation = implementation as? () -> Void {132 concreteImplementation()133 } else if let concreteImplementation = implementation as? () -> Void {134 concreteImplementation()135 }136 }137 }138 public func `saveContext`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Void, Void> {139 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`saveContext`() -> Void", arguments: [])140 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Void, Void>(mock: self, invocation: invocation)141 }142}143/// Initialize an initializable class mock of `SwiftUIApp.AppDelegate`.144public func mock(_ type: SwiftUIApp.AppDelegate.Type, file: StaticString = #file, line: UInt = #line) -> AppDelegateMock.InitializerProxy.Type {145 return AppDelegateMock.InitializerProxy.self146}147// MARK: - Mocked Assembler148public final class AssemblerMock: SwiftUIApp.Assembler, Mockingbird.Mock {149 static let staticMock = Mockingbird.StaticMock()150 public let mockingContext = Mockingbird.MockingContext()151 public let stubbingContext = Mockingbird.StubbingContext()152 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])153 public var sourceLocation: Mockingbird.SourceLocation? {154 get { return stubbingContext.sourceLocation }155 set {156 stubbingContext.sourceLocation = newValue157 AssemblerMock.staticMock.stubbingContext.sourceLocation = newValue158 }159 }160 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {161 super.init()162 Mockingbird.checkVersion(for: self)163 self.sourceLocation = sourceLocation164 }165}166/// Initialize a class mock of `SwiftUIApp.Assembler`.167public func mock(_ type: SwiftUIApp.Assembler.Type, file: StaticString = #file, line: UInt = #line) -> AssemblerMock {168 return AssemblerMock(sourceLocation: SourceLocation(file, line))169}170// MARK: - Mocked Bird171public final class BirdMock: SwiftUIApp.Bird, Mockingbird.Mock {172 static let staticMock = Mockingbird.StaticMock()173 public let mockingContext = Mockingbird.MockingContext()174 public let stubbingContext = Mockingbird.StubbingContext()175 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])176 public var sourceLocation: Mockingbird.SourceLocation? {177 get { return stubbingContext.sourceLocation }178 set {179 stubbingContext.sourceLocation = newValue180 BirdMock.staticMock.stubbingContext.sourceLocation = newValue181 }182 }183 // MARK: Mocked canFly184 public var `canFly`: Bool {185 get {186 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "canFly.get", arguments: [])187 return mockingContext.didInvoke(invocation) { () -> Bool in188 let implementation = stubbingContext.implementation(for: invocation)189 if let concreteImplementation = implementation as? () -> Bool {190 return concreteImplementation()191 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (Bool).self) {192 return defaultValue193 } else {194 fatalError(stubbingContext.failTest(for: invocation))195 }196 }197 }198 }199 public func getCanFly() -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Bool, Bool> {200 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "canFly.get", arguments: [])201 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Bool, Bool>(mock: self, invocation: invocation)202 }203 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {204 Mockingbird.checkVersion(for: self)205 self.sourceLocation = sourceLocation206 }207 // MARK: Mocked `fly`()208 public func `fly`() -> Void {209 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`fly`() -> Void", arguments: [])210 mockingContext.didInvoke(invocation) { () -> Void in211 let implementation = stubbingContext.implementation(for: invocation)212 if let concreteImplementation = implementation as? () -> Void {213 concreteImplementation()214 } else if let concreteImplementation = implementation as? () -> Void {215 concreteImplementation()216 }217 }218 }219 public func `fly`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Void, Void> {220 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`fly`() -> Void", arguments: [])221 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Void, Void>(mock: self, invocation: invocation)222 }223}224/// Initialize a protocol mock of `SwiftUIApp.Bird`.225public func mock(_ type: SwiftUIApp.Bird.Protocol, file: StaticString = #file, line: UInt = #line) -> BirdMock {226 return BirdMock(sourceLocation: SourceLocation(file, line))227}228// MARK: - Mocked ContactsDataSource229public final class ContactsDataSourceMock: SwiftUIApp.ContactsDataSource, Mockingbird.Mock {230 static let staticMock = Mockingbird.StaticMock()231 public let mockingContext = Mockingbird.MockingContext()232 public let stubbingContext = Mockingbird.StubbingContext()233 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])234 public var sourceLocation: Mockingbird.SourceLocation? {235 get { return stubbingContext.sourceLocation }236 set {237 stubbingContext.sourceLocation = newValue238 ContactsDataSourceMock.staticMock.stubbingContext.sourceLocation = newValue239 }240 }241 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {242 Mockingbird.checkVersion(for: self)243 self.sourceLocation = sourceLocation244 }245}246/// Initialize a protocol mock of `SwiftUIApp.ContactsDataSource`.247public func mock(_ type: SwiftUIApp.ContactsDataSource.Protocol, file: StaticString = #file, line: UInt = #line) -> ContactsDataSourceMock {248 return ContactsDataSourceMock(sourceLocation: SourceLocation(file, line))249}250// MARK: - Mocked ContactsListPresenter251public final class ContactsListPresenterMock: SwiftUIApp.ContactsListPresenter, Mockingbird.Mock {252 static let staticMock = Mockingbird.StaticMock()253 public let mockingContext = Mockingbird.MockingContext()254 public let stubbingContext = Mockingbird.StubbingContext()255 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])256 public var sourceLocation: Mockingbird.SourceLocation? {257 get { return stubbingContext.sourceLocation }258 set {259 stubbingContext.sourceLocation = newValue260 ContactsListPresenterMock.staticMock.stubbingContext.sourceLocation = newValue261 }262 }263 public enum InitializerProxy {264 public static func initialize(`user`: SwiftUIApp.User, `getAllContacts`: SwiftUIApp.GetAllContacts, __file: StaticString = #file, __line: UInt = #line) -> ContactsListPresenterMock {265 let mock: ContactsListPresenterMock = ContactsListPresenterMock(user: `user`, getAllContacts: `getAllContacts`)266 mock.sourceLocation = SourceLocation(__file, __line)267 return mock268 }269 }270 // MARK: Mocked init(`user`: SwiftUIApp.User, `getAllContacts`: SwiftUIApp.GetAllContacts)271 public required override init(`user`: SwiftUIApp.User, `getAllContacts`: SwiftUIApp.GetAllContacts) {272 super.init(user: `user`, getAllContacts: `getAllContacts`)273 Mockingbird.checkVersion(for: self)274 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "init(`user`: SwiftUIApp.User, `getAllContacts`: SwiftUIApp.GetAllContacts) ", arguments: [Mockingbird.ArgumentMatcher(`user`), Mockingbird.ArgumentMatcher(`getAllContacts`)])275 mockingContext.didInvoke(invocation)276 }277}278/// Initialize an initializable class mock of `SwiftUIApp.ContactsListPresenter`.279public func mock(_ type: SwiftUIApp.ContactsListPresenter.Type, file: StaticString = #file, line: UInt = #line) -> ContactsListPresenterMock.InitializerProxy.Type {280 return ContactsListPresenterMock.InitializerProxy.self281}282// MARK: - Mocked ContactsListViewController283public final class ContactsListViewControllerMock: SwiftUIApp.ContactsListViewController, Mockingbird.Mock {284 static let staticMock = Mockingbird.StaticMock()285 public let mockingContext = Mockingbird.MockingContext()286 public let stubbingContext = Mockingbird.StubbingContext()287 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])288 public var sourceLocation: Mockingbird.SourceLocation? {289 get { return stubbingContext.sourceLocation }290 set {291 stubbingContext.sourceLocation = newValue292 ContactsListViewControllerMock.staticMock.stubbingContext.sourceLocation = newValue293 }294 }295 public enum InitializerProxy {296 public static func initialize(`presenter`: SwiftUIApp.ContactsListPresenter, __file: StaticString = #file, __line: UInt = #line) -> ContactsListViewControllerMock {297 let mock: ContactsListViewControllerMock = ContactsListViewControllerMock(presenter: `presenter`)298 mock.sourceLocation = SourceLocation(__file, __line)299 return mock300 }301 }302 // MARK: Mocked init(`presenter`: SwiftUIApp.ContactsListPresenter)303 public required override init(`presenter`: SwiftUIApp.ContactsListPresenter) {304 super.init(presenter: `presenter`)305 Mockingbird.checkVersion(for: self)306 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "init(`presenter`: SwiftUIApp.ContactsListPresenter) ", arguments: [Mockingbird.ArgumentMatcher(`presenter`)])307 mockingContext.didInvoke(invocation)308 }309}310/// Initialize an initializable class mock of `SwiftUIApp.ContactsListViewController`.311public func mock(_ type: SwiftUIApp.ContactsListViewController.Type, file: StaticString = #file, line: UInt = #line) -> ContactsListViewControllerMock.InitializerProxy.Type {312 return ContactsListViewControllerMock.InitializerProxy.self313}314// MARK: - Mocked ContactsSceneAssembler315public final class ContactsSceneAssemblerMock: SwiftUIApp.ContactsSceneAssembler, Mockingbird.Mock {316 static let staticMock = Mockingbird.StaticMock()317 public let mockingContext = Mockingbird.MockingContext()318 public let stubbingContext = Mockingbird.StubbingContext()319 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])320 public var sourceLocation: Mockingbird.SourceLocation? {321 get { return stubbingContext.sourceLocation }322 set {323 stubbingContext.sourceLocation = newValue324 ContactsSceneAssemblerMock.staticMock.stubbingContext.sourceLocation = newValue325 }326 }327 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {328 Mockingbird.checkVersion(for: self)329 self.sourceLocation = sourceLocation330 }331 // MARK: Mocked `resolve`()332 public func `resolve`() -> SwiftUIApp.ContactsDataSource {333 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`() -> SwiftUIApp.ContactsDataSource", arguments: [])334 return mockingContext.didInvoke(invocation) { () -> SwiftUIApp.ContactsDataSource in335 let implementation = stubbingContext.implementation(for: invocation)336 if let concreteImplementation = implementation as? () -> SwiftUIApp.ContactsDataSource {337 return concreteImplementation()338 } else if let concreteImplementation = implementation as? () -> SwiftUIApp.ContactsDataSource {339 return concreteImplementation()340 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (SwiftUIApp.ContactsDataSource).self) {341 return defaultValue342 } else {343 fatalError(stubbingContext.failTest(for: invocation))344 }345 }346 }347 public func `resolve`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> SwiftUIApp.ContactsDataSource, SwiftUIApp.ContactsDataSource> {348 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`() -> SwiftUIApp.ContactsDataSource", arguments: [])349 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> SwiftUIApp.ContactsDataSource, SwiftUIApp.ContactsDataSource>(mock: self, invocation: invocation)350 }351 // MARK: Mocked `resolve`()352 public func `resolve`() -> SwiftUIApp.GetAllContacts {353 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`() -> SwiftUIApp.GetAllContacts", arguments: [])354 return mockingContext.didInvoke(invocation) { () -> SwiftUIApp.GetAllContacts in355 let implementation = stubbingContext.implementation(for: invocation)356 if let concreteImplementation = implementation as? () -> SwiftUIApp.GetAllContacts {357 return concreteImplementation()358 } else if let concreteImplementation = implementation as? () -> SwiftUIApp.GetAllContacts {359 return concreteImplementation()360 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (SwiftUIApp.GetAllContacts).self) {361 return defaultValue362 } else {363 fatalError(stubbingContext.failTest(for: invocation))364 }365 }366 }367 public func `resolve`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> SwiftUIApp.GetAllContacts, SwiftUIApp.GetAllContacts> {368 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`() -> SwiftUIApp.GetAllContacts", arguments: [])369 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> SwiftUIApp.GetAllContacts, SwiftUIApp.GetAllContacts>(mock: self, invocation: invocation)370 }371 // MARK: Mocked `resolve`(`user`: SwiftUIApp.User)372 public func `resolve`(`user`: SwiftUIApp.User) -> SwiftUIApp.ContactsListPresenter {373 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`(`user`: SwiftUIApp.User) -> SwiftUIApp.ContactsListPresenter", arguments: [Mockingbird.ArgumentMatcher(`user`)])374 return mockingContext.didInvoke(invocation) { () -> SwiftUIApp.ContactsListPresenter in375 let implementation = stubbingContext.implementation(for: invocation)376 if let concreteImplementation = implementation as? (SwiftUIApp.User) -> SwiftUIApp.ContactsListPresenter {377 return concreteImplementation(`user`)378 } else if let concreteImplementation = implementation as? () -> SwiftUIApp.ContactsListPresenter {379 return concreteImplementation()380 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (SwiftUIApp.ContactsListPresenter).self) {381 return defaultValue382 } else {383 fatalError(stubbingContext.failTest(for: invocation))384 }385 }386 }387 public func `resolve`(`user`: @escaping @autoclosure () -> SwiftUIApp.User) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (SwiftUIApp.User) -> SwiftUIApp.ContactsListPresenter, SwiftUIApp.ContactsListPresenter> {388 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`user`)]389 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`(`user`: SwiftUIApp.User) -> SwiftUIApp.ContactsListPresenter", arguments: arguments)390 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (SwiftUIApp.User) -> SwiftUIApp.ContactsListPresenter, SwiftUIApp.ContactsListPresenter>(mock: self, invocation: invocation)391 }392 // MARK: Mocked `resolve`(`user`: SwiftUIApp.User)393 public func `resolve`(`user`: SwiftUIApp.User) -> SwiftUIApp.ContactsListViewController {394 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`(`user`: SwiftUIApp.User) -> SwiftUIApp.ContactsListViewController", arguments: [Mockingbird.ArgumentMatcher(`user`)])395 return mockingContext.didInvoke(invocation) { () -> SwiftUIApp.ContactsListViewController in396 let implementation = stubbingContext.implementation(for: invocation)397 if let concreteImplementation = implementation as? (SwiftUIApp.User) -> SwiftUIApp.ContactsListViewController {398 return concreteImplementation(`user`)399 } else if let concreteImplementation = implementation as? () -> SwiftUIApp.ContactsListViewController {400 return concreteImplementation()401 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (SwiftUIApp.ContactsListViewController).self) {402 return defaultValue403 } else {404 fatalError(stubbingContext.failTest(for: invocation))405 }406 }407 }408 public func `resolve`(`user`: @escaping @autoclosure () -> SwiftUIApp.User) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (SwiftUIApp.User) -> SwiftUIApp.ContactsListViewController, SwiftUIApp.ContactsListViewController> {409 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`user`)]410 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`(`user`: SwiftUIApp.User) -> SwiftUIApp.ContactsListViewController", arguments: arguments)411 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (SwiftUIApp.User) -> SwiftUIApp.ContactsListViewController, SwiftUIApp.ContactsListViewController>(mock: self, invocation: invocation)412 }413}414/// Initialize a protocol mock of `SwiftUIApp.ContactsSceneAssembler`.415public func mock(_ type: SwiftUIApp.ContactsSceneAssembler.Protocol, file: StaticString = #file, line: UInt = #line) -> ContactsSceneAssemblerMock {416 return ContactsSceneAssemblerMock(sourceLocation: SourceLocation(file, line))417}418// MARK: - Mocked CounterService419public final class CounterServiceMock: SwiftUIApp.CounterService, Mockingbird.Mock {420 static let staticMock = Mockingbird.StaticMock()421 public let mockingContext = Mockingbird.MockingContext()422 public let stubbingContext = Mockingbird.StubbingContext()423 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])424 public var sourceLocation: Mockingbird.SourceLocation? {425 get { return stubbingContext.sourceLocation }426 set {427 stubbingContext.sourceLocation = newValue428 CounterServiceMock.staticMock.stubbingContext.sourceLocation = newValue429 }430 }431 // MARK: Mocked counter432 public var `counter`: Int {433 get {434 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "counter.get", arguments: [])435 return mockingContext.didInvoke(invocation) { () -> Int in436 let implementation = stubbingContext.implementation(for: invocation)437 if let concreteImplementation = implementation as? () -> Int {438 return concreteImplementation()439 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (Int).self) {440 return defaultValue441 } else {442 fatalError(stubbingContext.failTest(for: invocation))443 }444 }445 }446 }447 public func getCounter() -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Int, Int> {448 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "counter.get", arguments: [])449 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Int, Int>(mock: self, invocation: invocation)450 }451 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {452 Mockingbird.checkVersion(for: self)453 self.sourceLocation = sourceLocation454 }455 // MARK: Mocked `decrement`(_ `value`: Int)456 public func `decrement`(_ `value`: Int) -> Void {457 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`decrement`(_ `value`: Int) -> Void", arguments: [Mockingbird.ArgumentMatcher(`value`)])458 mockingContext.didInvoke(invocation) { () -> Void in459 let implementation = stubbingContext.implementation(for: invocation)460 if let concreteImplementation = implementation as? (Int) -> Void {461 concreteImplementation(`value`)462 } else if let concreteImplementation = implementation as? () -> Void {463 concreteImplementation()464 }465 }466 }467 public func `decrement`(_ `value`: @escaping @autoclosure () -> Int) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Int) -> Void, Void> {468 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`value`)]469 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`decrement`(_ `value`: Int) -> Void", arguments: arguments)470 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Int) -> Void, Void>(mock: self, invocation: invocation)471 }472 // MARK: Mocked `getCounter`()473 public func `getCounter`() -> Int {474 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`getCounter`() -> Int", arguments: [])475 return mockingContext.didInvoke(invocation) { () -> Int in476 let implementation = stubbingContext.implementation(for: invocation)477 if let concreteImplementation = implementation as? () -> Int {478 return concreteImplementation()479 } else if let concreteImplementation = implementation as? () -> Int {480 return concreteImplementation()481 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (Int).self) {482 return defaultValue483 } else {484 fatalError(stubbingContext.failTest(for: invocation))485 }486 }487 }488 public func `getCounter`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Int, Int> {489 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`getCounter`() -> Int", arguments: [])490 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Int, Int>(mock: self, invocation: invocation)491 }492 // MARK: Mocked `increment`(_ `value`: Int)493 public func `increment`(_ `value`: Int) -> Void {494 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`increment`(_ `value`: Int) -> Void", arguments: [Mockingbird.ArgumentMatcher(`value`)])495 mockingContext.didInvoke(invocation) { () -> Void in496 let implementation = stubbingContext.implementation(for: invocation)497 if let concreteImplementation = implementation as? (Int) -> Void {498 concreteImplementation(`value`)499 } else if let concreteImplementation = implementation as? () -> Void {500 concreteImplementation()501 }502 }503 }504 public func `increment`(_ `value`: @escaping @autoclosure () -> Int) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Int) -> Void, Void> {505 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`value`)]506 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`increment`(_ `value`: Int) -> Void", arguments: arguments)507 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Int) -> Void, Void>(mock: self, invocation: invocation)508 }509}510/// Initialize a protocol mock of `SwiftUIApp.CounterService`.511public func mock(_ type: SwiftUIApp.CounterService.Protocol, file: StaticString = #file, line: UInt = #line) -> CounterServiceMock {512 return CounterServiceMock(sourceLocation: SourceLocation(file, line))513}514// MARK: - Mocked GetAllContacts515public final class GetAllContactsMock: SwiftUIApp.GetAllContacts, Mockingbird.Mock {516 static let staticMock = Mockingbird.StaticMock()517 public let mockingContext = Mockingbird.MockingContext()518 public let stubbingContext = Mockingbird.StubbingContext()519 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])520 public var sourceLocation: Mockingbird.SourceLocation? {521 get { return stubbingContext.sourceLocation }522 set {523 stubbingContext.sourceLocation = newValue524 GetAllContactsMock.staticMock.stubbingContext.sourceLocation = newValue525 }526 }527 public enum InitializerProxy {528 public static func initialize(`contactsDataSource`: SwiftUIApp.ContactsDataSource, __file: StaticString = #file, __line: UInt = #line) -> GetAllContactsMock {529 let mock: GetAllContactsMock = GetAllContactsMock(contactsDataSource: `contactsDataSource`)530 mock.sourceLocation = SourceLocation(__file, __line)531 return mock532 }533 }534 // MARK: Mocked init(`contactsDataSource`: SwiftUIApp.ContactsDataSource)535 public required override init(`contactsDataSource`: SwiftUIApp.ContactsDataSource) {536 super.init(contactsDataSource: `contactsDataSource`)537 Mockingbird.checkVersion(for: self)538 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "init(`contactsDataSource`: SwiftUIApp.ContactsDataSource) ", arguments: [Mockingbird.ArgumentMatcher(`contactsDataSource`)])539 mockingContext.didInvoke(invocation)540 }541}542/// Initialize an initializable class mock of `SwiftUIApp.GetAllContacts`.543public func mock(_ type: SwiftUIApp.GetAllContacts.Type, file: StaticString = #file, line: UInt = #line) -> GetAllContactsMock.InitializerProxy.Type {544 return GetAllContactsMock.InitializerProxy.self545}546// MARK: - Mocked ImageSaver547public final class ImageSaverMock: SwiftUIApp.ImageSaver, Mockingbird.Mock {548 static let staticMock = Mockingbird.StaticMock()549 public let mockingContext = Mockingbird.MockingContext()550 public let stubbingContext = Mockingbird.StubbingContext()551 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])552 public var sourceLocation: Mockingbird.SourceLocation? {553 get { return stubbingContext.sourceLocation }554 set {555 stubbingContext.sourceLocation = newValue556 ImageSaverMock.staticMock.stubbingContext.sourceLocation = newValue557 }558 }559 public enum InitializerProxy {}560 // MARK: Mocked `saveError`(_ `image`: UIImage, `didFinishSavingWithError` `error`: Error?, `contextInfo`: UnsafeRawPointer)561 public override func `saveError`(_ `image`: UIImage, `didFinishSavingWithError` `error`: Error?, `contextInfo`: UnsafeRawPointer) -> Void {562 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`saveError`(_ `image`: UIImage, `didFinishSavingWithError` `error`: Error?, `contextInfo`: UnsafeRawPointer) -> Void", arguments: [Mockingbird.ArgumentMatcher(`image`), Mockingbird.ArgumentMatcher(`error`), Mockingbird.ArgumentMatcher(`contextInfo`)])563 mockingContext.didInvoke(invocation) { () -> Void in564 let implementation = stubbingContext.implementation(for: invocation)565 if let concreteImplementation = implementation as? (UIImage, Error?, UnsafeRawPointer) -> Void {566 concreteImplementation(`image`, `error`, `contextInfo`)567 } else if let concreteImplementation = implementation as? () -> Void {568 concreteImplementation()569 }570 }571 }572 public func `saveError`(_ `image`: @escaping @autoclosure () -> UIImage, `didFinishSavingWithError` `error`: @escaping @autoclosure () -> Error?, `contextInfo`: @escaping @autoclosure () -> UnsafeRawPointer) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIImage, Error?, UnsafeRawPointer) -> Void, Void> {573 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`image`), Mockingbird.resolve(`error`), Mockingbird.resolve(`contextInfo`)]574 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`saveError`(_ `image`: UIImage, `didFinishSavingWithError` `error`: Error?, `contextInfo`: UnsafeRawPointer) -> Void", arguments: arguments)575 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIImage, Error?, UnsafeRawPointer) -> Void, Void>(mock: self, invocation: invocation)576 }577 // MARK: Mocked `writeToPhotoAlbun`(`image`: UIImage)578 public override func `writeToPhotoAlbun`(`image`: UIImage) -> Void {579 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`writeToPhotoAlbun`(`image`: UIImage) -> Void", arguments: [Mockingbird.ArgumentMatcher(`image`)])580 mockingContext.didInvoke(invocation) { () -> Void in581 let implementation = stubbingContext.implementation(for: invocation)582 if let concreteImplementation = implementation as? (UIImage) -> Void {583 concreteImplementation(`image`)584 } else if let concreteImplementation = implementation as? () -> Void {585 concreteImplementation()586 }587 }588 }589 public func `writeToPhotoAlbun`(`image`: @escaping @autoclosure () -> UIImage) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIImage) -> Void, Void> {590 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`image`)]591 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`writeToPhotoAlbun`(`image`: UIImage) -> Void", arguments: arguments)592 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIImage) -> Void, Void>(mock: self, invocation: invocation)593 }594}595/// Initialize an initializable class mock of `SwiftUIApp.ImageSaver`.596public func mock(_ type: SwiftUIApp.ImageSaver.Type, file: StaticString = #file, line: UInt = #line) -> ImageSaverMock.InitializerProxy.Type {597 return ImageSaverMock.InitializerProxy.self598}599// MARK: - Mocked MockCounterService600public final class MockCounterServiceMock: SwiftUIApp.MockCounterService, Mockingbird.Mock {601 static let staticMock = Mockingbird.StaticMock()602 public let mockingContext = Mockingbird.MockingContext()603 public let stubbingContext = Mockingbird.StubbingContext()604 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])605 public var sourceLocation: Mockingbird.SourceLocation? {606 get { return stubbingContext.sourceLocation }607 set {608 stubbingContext.sourceLocation = newValue609 MockCounterServiceMock.staticMock.stubbingContext.sourceLocation = newValue610 }611 }612 // MARK: Mocked counter613 override public var `counter`: Int {614 get {615 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "counter.get", arguments: [])616 return mockingContext.didInvoke(invocation) { () -> Int in617 let implementation = stubbingContext.implementation(for: invocation)618 if let concreteImplementation = implementation as? () -> Int {619 return concreteImplementation()620 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (Int).self) {621 return defaultValue622 } else {623 fatalError(stubbingContext.failTest(for: invocation))624 }625 }626 }627 set {628 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "counter.set", arguments: [ArgumentMatcher(newValue)])629 mockingContext.didInvoke(invocation)630 let implementation = stubbingContext.implementation(for: invocation)631 if let concreteImplementation = implementation as? (Int) -> Void {632 concreteImplementation(newValue)633 } else {634 (implementation as? () -> Void)?()635 }636 }637 }638 public func getCounter() -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Int, Int> {639 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "counter.get", arguments: [])640 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Int, Int>(mock: self, invocation: invocation)641 }642 public func setCounter(_ newValue: @escaping @autoclosure () -> Int) -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, (Int) -> Void, Void> {643 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]644 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "counter.set", arguments: arguments)645 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, (Int) -> Void, Void>(mock: self, invocation: invocation)646 }647 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {648 super.init()649 Mockingbird.checkVersion(for: self)650 self.sourceLocation = sourceLocation651 }652 // MARK: Mocked `decrement`(_ `value`: Int)653 public override func `decrement`(_ `value`: Int) -> Void {654 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`decrement`(_ `value`: Int) -> Void", arguments: [Mockingbird.ArgumentMatcher(`value`)])655 mockingContext.didInvoke(invocation) { () -> Void in656 let implementation = stubbingContext.implementation(for: invocation)657 if let concreteImplementation = implementation as? (Int) -> Void {658 concreteImplementation(`value`)659 } else if let concreteImplementation = implementation as? () -> Void {660 concreteImplementation()661 }662 }663 }664 public func `decrement`(_ `value`: @escaping @autoclosure () -> Int) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Int) -> Void, Void> {665 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`value`)]666 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`decrement`(_ `value`: Int) -> Void", arguments: arguments)667 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Int) -> Void, Void>(mock: self, invocation: invocation)668 }669 // MARK: Mocked `getCounter`()670 public override func `getCounter`() -> Int {671 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`getCounter`() -> Int", arguments: [])672 return mockingContext.didInvoke(invocation) { () -> Int in673 let implementation = stubbingContext.implementation(for: invocation)674 if let concreteImplementation = implementation as? () -> Int {675 return concreteImplementation()676 } else if let concreteImplementation = implementation as? () -> Int {677 return concreteImplementation()678 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (Int).self) {679 return defaultValue680 } else {681 fatalError(stubbingContext.failTest(for: invocation))682 }683 }684 }685 public func `getCounter`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Int, Int> {686 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`getCounter`() -> Int", arguments: [])687 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Int, Int>(mock: self, invocation: invocation)688 }689 // MARK: Mocked `increment`(_ `value`: Int)690 public override func `increment`(_ `value`: Int) -> Void {691 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`increment`(_ `value`: Int) -> Void", arguments: [Mockingbird.ArgumentMatcher(`value`)])692 mockingContext.didInvoke(invocation) { () -> Void in693 let implementation = stubbingContext.implementation(for: invocation)694 if let concreteImplementation = implementation as? (Int) -> Void {695 concreteImplementation(`value`)696 } else if let concreteImplementation = implementation as? () -> Void {697 concreteImplementation()698 }699 }700 }701 public func `increment`(_ `value`: @escaping @autoclosure () -> Int) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Int) -> Void, Void> {702 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`value`)]703 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`increment`(_ `value`: Int) -> Void", arguments: arguments)704 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Int) -> Void, Void>(mock: self, invocation: invocation)705 }706}707/// Initialize a class mock of `SwiftUIApp.MockCounterService`.708public func mock(_ type: SwiftUIApp.MockCounterService.Type, file: StaticString = #file, line: UInt = #line) -> MockCounterServiceMock {709 return MockCounterServiceMock(sourceLocation: SourceLocation(file, line))710}711// MARK: - Mocked NetworkContactsDataSource712public final class NetworkContactsDataSourceMock: SwiftUIApp.NetworkContactsDataSource, Mockingbird.Mock {713 static let staticMock = Mockingbird.StaticMock()714 public let mockingContext = Mockingbird.MockingContext()715 public let stubbingContext = Mockingbird.StubbingContext()716 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])717 public var sourceLocation: Mockingbird.SourceLocation? {718 get { return stubbingContext.sourceLocation }719 set {720 stubbingContext.sourceLocation = newValue721 NetworkContactsDataSourceMock.staticMock.stubbingContext.sourceLocation = newValue722 }723 }724 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {725 super.init()726 Mockingbird.checkVersion(for: self)727 self.sourceLocation = sourceLocation728 }729}730/// Initialize a class mock of `SwiftUIApp.NetworkContactsDataSource`.731public func mock(_ type: SwiftUIApp.NetworkContactsDataSource.Type, file: StaticString = #file, line: UInt = #line) -> NetworkContactsDataSourceMock {732 return NetworkContactsDataSourceMock(sourceLocation: SourceLocation(file, line))733}734// MARK: - Mocked NotificationHandler735public final class NotificationHandlerMock: SwiftUIApp.NotificationHandler, Mockingbird.Mock {736 static let staticMock = Mockingbird.StaticMock()737 public let mockingContext = Mockingbird.MockingContext()738 public let stubbingContext = Mockingbird.StubbingContext()739 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])740 public var sourceLocation: Mockingbird.SourceLocation? {741 get { return stubbingContext.sourceLocation }742 set {743 stubbingContext.sourceLocation = newValue744 NotificationHandlerMock.staticMock.stubbingContext.sourceLocation = newValue745 }746 }747 public enum InitializerProxy {}748 // MARK: Mocked addedObservers749 override public var `addedObservers`: Bool {750 get {751 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "addedObservers.get", arguments: [])752 return mockingContext.didInvoke(invocation) { () -> Bool in753 let implementation = stubbingContext.implementation(for: invocation)754 if let concreteImplementation = implementation as? () -> Bool {755 return concreteImplementation()756 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (Bool).self) {757 return defaultValue758 } else {759 fatalError(stubbingContext.failTest(for: invocation))760 }761 }762 }763 set {764 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "addedObservers.set", arguments: [ArgumentMatcher(newValue)])765 mockingContext.didInvoke(invocation)766 let implementation = stubbingContext.implementation(for: invocation)767 if let concreteImplementation = implementation as? (Bool) -> Void {768 concreteImplementation(newValue)769 } else {770 (implementation as? () -> Void)?()771 }772 }773 }774 public func getAddedObservers() -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Bool, Bool> {775 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "addedObservers.get", arguments: [])776 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Bool, Bool>(mock: self, invocation: invocation)777 }778 public func setAddedObservers(_ newValue: @escaping @autoclosure () -> Bool) -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, (Bool) -> Void, Void> {779 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]780 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "addedObservers.set", arguments: arguments)781 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, (Bool) -> Void, Void>(mock: self, invocation: invocation)782 }783 // MARK: Mocked messageReceivedCounter784 override public var `messageReceivedCounter`: Int {785 get {786 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "messageReceivedCounter.get", arguments: [])787 return mockingContext.didInvoke(invocation) { () -> Int in788 let implementation = stubbingContext.implementation(for: invocation)789 if let concreteImplementation = implementation as? () -> Int {790 return concreteImplementation()791 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (Int).self) {792 return defaultValue793 } else {794 fatalError(stubbingContext.failTest(for: invocation))795 }796 }797 }798 set {799 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "messageReceivedCounter.set", arguments: [ArgumentMatcher(newValue)])800 mockingContext.didInvoke(invocation)801 let implementation = stubbingContext.implementation(for: invocation)802 if let concreteImplementation = implementation as? (Int) -> Void {803 concreteImplementation(newValue)804 } else {805 (implementation as? () -> Void)?()806 }807 }808 }809 public func getMessageReceivedCounter() -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Int, Int> {810 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "messageReceivedCounter.get", arguments: [])811 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> Int, Int>(mock: self, invocation: invocation)812 }813 public func setMessageReceivedCounter(_ newValue: @escaping @autoclosure () -> Int) -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, (Int) -> Void, Void> {814 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]815 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "messageReceivedCounter.set", arguments: arguments)816 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, (Int) -> Void, Void>(mock: self, invocation: invocation)817 }818 // MARK: Mocked message819 override public var `message`: String? {820 get {821 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "message.get", arguments: [])822 return mockingContext.didInvoke(invocation) { () -> String? in823 let implementation = stubbingContext.implementation(for: invocation)824 if let concreteImplementation = implementation as? () -> String? {825 return concreteImplementation()826 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (String?).self) {827 return defaultValue828 } else {829 fatalError(stubbingContext.failTest(for: invocation))830 }831 }832 }833 set {834 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "message.set", arguments: [ArgumentMatcher(newValue)])835 mockingContext.didInvoke(invocation)836 let implementation = stubbingContext.implementation(for: invocation)837 if let concreteImplementation = implementation as? (String?) -> Void {838 concreteImplementation(newValue)839 } else {840 (implementation as? () -> Void)?()841 }842 }843 }844 public func getMessage() -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> String?, String?> {845 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "message.get", arguments: [])846 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> String?, String?>(mock: self, invocation: invocation)847 }848 public func setMessage(_ newValue: @escaping @autoclosure () -> String?) -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, (String?) -> Void, Void> {849 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]850 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "message.set", arguments: arguments)851 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, (String?) -> Void, Void>(mock: self, invocation: invocation)852 }853 // MARK: Mocked `didClearData`(_ `notification`: Notification)854 public override func `didClearData`(_ `notification`: Notification) -> Void {855 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`didClearData`(_ `notification`: Notification) -> Void", arguments: [Mockingbird.ArgumentMatcher(`notification`)])856 mockingContext.didInvoke(invocation) { () -> Void in857 let implementation = stubbingContext.implementation(for: invocation)858 if let concreteImplementation = implementation as? (Notification) -> Void {859 concreteImplementation(`notification`)860 } else if let concreteImplementation = implementation as? () -> Void {861 concreteImplementation()862 }863 }864 }865 public func `didClearData`(_ `notification`: @escaping @autoclosure () -> Notification) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Notification) -> Void, Void> {866 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`notification`)]867 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`didClearData`(_ `notification`: Notification) -> Void", arguments: arguments)868 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Notification) -> Void, Void>(mock: self, invocation: invocation)869 }870 // MARK: Mocked `didReceiveData`(_ `notification`: Notification)871 public override func `didReceiveData`(_ `notification`: Notification) -> Void {872 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`didReceiveData`(_ `notification`: Notification) -> Void", arguments: [Mockingbird.ArgumentMatcher(`notification`)])873 mockingContext.didInvoke(invocation) { () -> Void in874 let implementation = stubbingContext.implementation(for: invocation)875 if let concreteImplementation = implementation as? (Notification) -> Void {876 concreteImplementation(`notification`)877 } else if let concreteImplementation = implementation as? () -> Void {878 concreteImplementation()879 }880 }881 }882 public func `didReceiveData`(_ `notification`: @escaping @autoclosure () -> Notification) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Notification) -> Void, Void> {883 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`notification`)]884 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`didReceiveData`(_ `notification`: Notification) -> Void", arguments: arguments)885 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (Notification) -> Void, Void>(mock: self, invocation: invocation)886 }887 // MARK: Mocked `setupObservers`()888 public override func `setupObservers`() -> Void {889 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`setupObservers`() -> Void", arguments: [])890 mockingContext.didInvoke(invocation) { () -> Void in891 let implementation = stubbingContext.implementation(for: invocation)892 if let concreteImplementation = implementation as? () -> Void {893 concreteImplementation()894 } else if let concreteImplementation = implementation as? () -> Void {895 concreteImplementation()896 }897 }898 }899 public func `setupObservers`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Void, Void> {900 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`setupObservers`() -> Void", arguments: [])901 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Void, Void>(mock: self, invocation: invocation)902 }903}904/// Initialize an initializable class mock of `SwiftUIApp.NotificationHandler`.905public func mock(_ type: SwiftUIApp.NotificationHandler.Type, file: StaticString = #file, line: UInt = #line) -> NotificationHandlerMock.InitializerProxy.Type {906 return NotificationHandlerMock.InitializerProxy.self907}908// MARK: - Mocked SceneDelegate909public final class SceneDelegateMock: SwiftUIApp.SceneDelegate, Mockingbird.Mock {910 static let staticMock = Mockingbird.StaticMock()911 public let mockingContext = Mockingbird.MockingContext()912 public let stubbingContext = Mockingbird.StubbingContext()913 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])914 public var sourceLocation: Mockingbird.SourceLocation? {915 get { return stubbingContext.sourceLocation }916 set {917 stubbingContext.sourceLocation = newValue918 SceneDelegateMock.staticMock.stubbingContext.sourceLocation = newValue919 }920 }921 public enum InitializerProxy {}922 // MARK: Mocked window923 override public var `window`: UIWindow? {924 get {925 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "window.get", arguments: [])926 return mockingContext.didInvoke(invocation) { () -> UIWindow? in927 let implementation = stubbingContext.implementation(for: invocation)928 if let concreteImplementation = implementation as? () -> UIWindow? {929 return concreteImplementation()930 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (UIWindow?).self) {931 return defaultValue932 } else {933 fatalError(stubbingContext.failTest(for: invocation))934 }935 }936 }937 set {938 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "window.set", arguments: [ArgumentMatcher(newValue)])939 mockingContext.didInvoke(invocation)940 let implementation = stubbingContext.implementation(for: invocation)941 if let concreteImplementation = implementation as? (UIWindow?) -> Void {942 concreteImplementation(newValue)943 } else {944 (implementation as? () -> Void)?()945 }946 }947 }948 public func getWindow() -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> UIWindow?, UIWindow?> {949 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "window.get", arguments: [])950 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, () -> UIWindow?, UIWindow?>(mock: self, invocation: invocation)951 }952 public func setWindow(_ newValue: @escaping @autoclosure () -> UIWindow?) -> Mockingbird.Mockable<Mockingbird.VariableDeclaration, (UIWindow?) -> Void, Void> {953 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]954 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "window.set", arguments: arguments)955 return Mockingbird.Mockable<Mockingbird.VariableDeclaration, (UIWindow?) -> Void, Void>(mock: self, invocation: invocation)956 }957 // MARK: Mocked `scene`(_ `scene`: UIScene, `willConnectTo` `session`: UISceneSession, `options` `connectionOptions`: UIScene.ConnectionOptions)958 public override func `scene`(_ `scene`: UIScene, `willConnectTo` `session`: UISceneSession, `options` `connectionOptions`: UIScene.ConnectionOptions) -> Void {959 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`scene`(_ `scene`: UIScene, `willConnectTo` `session`: UISceneSession, `options` `connectionOptions`: UIScene.ConnectionOptions) -> Void", arguments: [Mockingbird.ArgumentMatcher(`scene`), Mockingbird.ArgumentMatcher(`session`), Mockingbird.ArgumentMatcher(`connectionOptions`)])960 mockingContext.didInvoke(invocation) { () -> Void in961 let implementation = stubbingContext.implementation(for: invocation)962 if let concreteImplementation = implementation as? (UIScene, UISceneSession, UIScene.ConnectionOptions) -> Void {963 concreteImplementation(`scene`, `session`, `connectionOptions`)964 } else if let concreteImplementation = implementation as? () -> Void {965 concreteImplementation()966 }967 }968 }969 public func `scene`(_ `scene`: @escaping @autoclosure () -> UIScene, `willConnectTo` `session`: @escaping @autoclosure () -> UISceneSession, `options` `connectionOptions`: @escaping @autoclosure () -> UIScene.ConnectionOptions) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene, UISceneSession, UIScene.ConnectionOptions) -> Void, Void> {970 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`scene`), Mockingbird.resolve(`session`), Mockingbird.resolve(`connectionOptions`)]971 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`scene`(_ `scene`: UIScene, `willConnectTo` `session`: UISceneSession, `options` `connectionOptions`: UIScene.ConnectionOptions) -> Void", arguments: arguments)972 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene, UISceneSession, UIScene.ConnectionOptions) -> Void, Void>(mock: self, invocation: invocation)973 }974 // MARK: Mocked `sceneDidBecomeActive`(_ `scene`: UIScene)975 public override func `sceneDidBecomeActive`(_ `scene`: UIScene) -> Void {976 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneDidBecomeActive`(_ `scene`: UIScene) -> Void", arguments: [Mockingbird.ArgumentMatcher(`scene`)])977 mockingContext.didInvoke(invocation) { () -> Void in978 let implementation = stubbingContext.implementation(for: invocation)979 if let concreteImplementation = implementation as? (UIScene) -> Void {980 concreteImplementation(`scene`)981 } else if let concreteImplementation = implementation as? () -> Void {982 concreteImplementation()983 }984 }985 }986 public func `sceneDidBecomeActive`(_ `scene`: @escaping @autoclosure () -> UIScene) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void> {987 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`scene`)]988 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneDidBecomeActive`(_ `scene`: UIScene) -> Void", arguments: arguments)989 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void>(mock: self, invocation: invocation)990 }991 // MARK: Mocked `sceneDidDisconnect`(_ `scene`: UIScene)992 public override func `sceneDidDisconnect`(_ `scene`: UIScene) -> Void {993 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneDidDisconnect`(_ `scene`: UIScene) -> Void", arguments: [Mockingbird.ArgumentMatcher(`scene`)])994 mockingContext.didInvoke(invocation) { () -> Void in995 let implementation = stubbingContext.implementation(for: invocation)996 if let concreteImplementation = implementation as? (UIScene) -> Void {997 concreteImplementation(`scene`)998 } else if let concreteImplementation = implementation as? () -> Void {999 concreteImplementation()1000 }1001 }1002 }1003 public func `sceneDidDisconnect`(_ `scene`: @escaping @autoclosure () -> UIScene) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void> {1004 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`scene`)]1005 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneDidDisconnect`(_ `scene`: UIScene) -> Void", arguments: arguments)1006 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void>(mock: self, invocation: invocation)1007 }1008 // MARK: Mocked `sceneDidEnterBackground`(_ `scene`: UIScene)1009 public override func `sceneDidEnterBackground`(_ `scene`: UIScene) -> Void {1010 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneDidEnterBackground`(_ `scene`: UIScene) -> Void", arguments: [Mockingbird.ArgumentMatcher(`scene`)])1011 mockingContext.didInvoke(invocation) { () -> Void in1012 let implementation = stubbingContext.implementation(for: invocation)1013 if let concreteImplementation = implementation as? (UIScene) -> Void {1014 concreteImplementation(`scene`)1015 } else if let concreteImplementation = implementation as? () -> Void {1016 concreteImplementation()1017 }1018 }1019 }1020 public func `sceneDidEnterBackground`(_ `scene`: @escaping @autoclosure () -> UIScene) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void> {1021 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`scene`)]1022 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneDidEnterBackground`(_ `scene`: UIScene) -> Void", arguments: arguments)1023 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void>(mock: self, invocation: invocation)1024 }1025 // MARK: Mocked `sceneWillEnterForeground`(_ `scene`: UIScene)1026 public override func `sceneWillEnterForeground`(_ `scene`: UIScene) -> Void {1027 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneWillEnterForeground`(_ `scene`: UIScene) -> Void", arguments: [Mockingbird.ArgumentMatcher(`scene`)])1028 mockingContext.didInvoke(invocation) { () -> Void in1029 let implementation = stubbingContext.implementation(for: invocation)1030 if let concreteImplementation = implementation as? (UIScene) -> Void {1031 concreteImplementation(`scene`)1032 } else if let concreteImplementation = implementation as? () -> Void {1033 concreteImplementation()1034 }1035 }1036 }1037 public func `sceneWillEnterForeground`(_ `scene`: @escaping @autoclosure () -> UIScene) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void> {1038 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`scene`)]1039 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneWillEnterForeground`(_ `scene`: UIScene) -> Void", arguments: arguments)1040 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void>(mock: self, invocation: invocation)1041 }1042 // MARK: Mocked `sceneWillResignActive`(_ `scene`: UIScene)1043 public override func `sceneWillResignActive`(_ `scene`: UIScene) -> Void {1044 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneWillResignActive`(_ `scene`: UIScene) -> Void", arguments: [Mockingbird.ArgumentMatcher(`scene`)])1045 mockingContext.didInvoke(invocation) { () -> Void in1046 let implementation = stubbingContext.implementation(for: invocation)1047 if let concreteImplementation = implementation as? (UIScene) -> Void {1048 concreteImplementation(`scene`)1049 } else if let concreteImplementation = implementation as? () -> Void {1050 concreteImplementation()1051 }1052 }1053 }1054 public func `sceneWillResignActive`(_ `scene`: @escaping @autoclosure () -> UIScene) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void> {1055 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(`scene`)]1056 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`sceneWillResignActive`(_ `scene`: UIScene) -> Void", arguments: arguments)1057 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (UIScene) -> Void, Void>(mock: self, invocation: invocation)1058 }1059}1060/// Initialize an initializable class mock of `SwiftUIApp.SceneDelegate`.1061public func mock(_ type: SwiftUIApp.SceneDelegate.Type, file: StaticString = #file, line: UInt = #line) -> SceneDelegateMock.InitializerProxy.Type {1062 return SceneDelegateMock.InitializerProxy.self1063}1064// MARK: - Mocked StubContactsDataSource1065public final class StubContactsDataSourceMock: SwiftUIApp.StubContactsDataSource, Mockingbird.Mock {1066 static let staticMock = Mockingbird.StaticMock()1067 public let mockingContext = Mockingbird.MockingContext()1068 public let stubbingContext = Mockingbird.StubbingContext()1069 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])1070 public var sourceLocation: Mockingbird.SourceLocation? {1071 get { return stubbingContext.sourceLocation }1072 set {1073 stubbingContext.sourceLocation = newValue1074 StubContactsDataSourceMock.staticMock.stubbingContext.sourceLocation = newValue1075 }1076 }1077 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {1078 super.init()1079 Mockingbird.checkVersion(for: self)1080 self.sourceLocation = sourceLocation1081 }1082}1083/// Initialize a class mock of `SwiftUIApp.StubContactsDataSource`.1084public func mock(_ type: SwiftUIApp.StubContactsDataSource.Type, file: StaticString = #file, line: UInt = #line) -> StubContactsDataSourceMock {1085 return StubContactsDataSourceMock(sourceLocation: SourceLocation(file, line))1086}1087// MARK: - Mocked TestAssembler1088public final class TestAssemblerMock: SwiftUIApp.TestAssembler, Mockingbird.Mock {1089 static let staticMock = Mockingbird.StaticMock()1090 public let mockingContext = Mockingbird.MockingContext()1091 public let stubbingContext = Mockingbird.StubbingContext()1092 public let mockMetadata = Mockingbird.MockMetadata(["generator_version": "0.12.0", "module_name": "SwiftUIApp"])1093 public var sourceLocation: Mockingbird.SourceLocation? {1094 get { return stubbingContext.sourceLocation }1095 set {1096 stubbingContext.sourceLocation = newValue1097 TestAssemblerMock.staticMock.stubbingContext.sourceLocation = newValue1098 }1099 }1100 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {1101 super.init()1102 Mockingbird.checkVersion(for: self)1103 self.sourceLocation = sourceLocation1104 }1105 // MARK: Mocked `resolve`()1106 public override func `resolve`() -> SwiftUIApp.ContactsDataSource {1107 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`() -> SwiftUIApp.ContactsDataSource", arguments: [])1108 return mockingContext.didInvoke(invocation) { () -> SwiftUIApp.ContactsDataSource in1109 let implementation = stubbingContext.implementation(for: invocation)1110 if let concreteImplementation = implementation as? () -> SwiftUIApp.ContactsDataSource {1111 return concreteImplementation()1112 } else if let concreteImplementation = implementation as? () -> SwiftUIApp.ContactsDataSource {1113 return concreteImplementation()1114 } else if let defaultValue = stubbingContext.defaultValueProvider.provideValue(for: (SwiftUIApp.ContactsDataSource).self) {1115 return defaultValue1116 } else {1117 fatalError(stubbingContext.failTest(for: invocation))1118 }1119 }1120 }1121 public func `resolve`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> SwiftUIApp.ContactsDataSource, SwiftUIApp.ContactsDataSource> {1122 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "`resolve`() -> SwiftUIApp.ContactsDataSource", arguments: [])1123 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> SwiftUIApp.ContactsDataSource, SwiftUIApp.ContactsDataSource>(mock: self, invocation: invocation)1124 }1125}1126/// Initialize a class mock of `SwiftUIApp.TestAssembler`.1127public func mock(_ type: SwiftUIApp.TestAssembler.Type, file: StaticString = #file, line: UInt = #line) -> TestAssemblerMock {1128 return TestAssemblerMock(sourceLocation: SourceLocation(file, line))1129}1130// MARK: - Mocked Tree1131public final class TreeMock: SwiftUIApp.Tree, Mockingbird.Mock {...

Full Screen

Full Screen

UseCaseInjectMocks.generated.swift

Source:UseCaseInjectMocks.generated.swift Github

copy

Full Screen

...41 return concreteImplementation()42 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo).self) {43 return defaultValue44 } else {45 fatalError(self.stubbingContext.failTest(for: invocation))46 }47 }48 }49 set {50 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "foo.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))51 self.mockingContext.didInvoke(invocation)52 let implementation = self.stubbingContext.implementation(for: invocation)53 if let concreteImplementation = implementation as? (UseCaseInject.Foo) -> Void {54 concreteImplementation(newValue)55 } else {56 (implementation as? () -> Void)?()57 }58 }59 }60 public func getFoo() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo> {61 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "foo.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))62 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo>(mock: self, invocation: invocation)63 }64 public func setFoo(_ newValue: @escaping @autoclosure () -> UseCaseInject.Foo) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void> {65 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]66 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "foo.set", arguments: arguments, returnType: Swift.ObjectIdentifier(Void.self))67 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void>(mock: self, invocation: invocation)68 }69 // MARK: Mocked fooCustomInit70 override public var `fooCustomInit`: UseCaseInject.Foo {71 get {72 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooCustomInit.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))73 return self.mockingContext.didInvoke(invocation) { () -> UseCaseInject.Foo in74 let implementation = self.stubbingContext.implementation(for: invocation)75 if let concreteImplementation = implementation as? () -> UseCaseInject.Foo {76 return concreteImplementation()77 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo).self) {78 return defaultValue79 } else {80 fatalError(self.stubbingContext.failTest(for: invocation))81 }82 }83 }84 set {85 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooCustomInit.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))86 self.mockingContext.didInvoke(invocation)87 let implementation = self.stubbingContext.implementation(for: invocation)88 if let concreteImplementation = implementation as? (UseCaseInject.Foo) -> Void {89 concreteImplementation(newValue)90 } else {91 (implementation as? () -> Void)?()92 }93 }94 }95 public func getFooCustomInit() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo> {96 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooCustomInit.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))97 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo>(mock: self, invocation: invocation)98 }99 public func setFooCustomInit(_ newValue: @escaping @autoclosure () -> UseCaseInject.Foo) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void> {100 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]101 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooCustomInit.set", arguments: arguments, returnType: Swift.ObjectIdentifier(Void.self))102 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void>(mock: self, invocation: invocation)103 }104 // MARK: Mocked fooData105 override public var `fooData`: UseCaseInject.Foo {106 get {107 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooData.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))108 return self.mockingContext.didInvoke(invocation) { () -> UseCaseInject.Foo in109 let implementation = self.stubbingContext.implementation(for: invocation)110 if let concreteImplementation = implementation as? () -> UseCaseInject.Foo {111 return concreteImplementation()112 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo).self) {113 return defaultValue114 } else {115 fatalError(self.stubbingContext.failTest(for: invocation))116 }117 }118 }119 set {120 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooData.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))121 self.mockingContext.didInvoke(invocation)122 let implementation = self.stubbingContext.implementation(for: invocation)123 if let concreteImplementation = implementation as? (UseCaseInject.Foo) -> Void {124 concreteImplementation(newValue)125 } else {126 (implementation as? () -> Void)?()127 }128 }129 }130 public func getFooData() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo> {131 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooData.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))132 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo>(mock: self, invocation: invocation)133 }134 public func setFooData(_ newValue: @escaping @autoclosure () -> UseCaseInject.Foo) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void> {135 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]136 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooData.set", arguments: arguments, returnType: Swift.ObjectIdentifier(Void.self))137 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void>(mock: self, invocation: invocation)138 }139 // MARK: Mocked fooLazy140 override public var `fooLazy`: UseCaseInject.Foo {141 get {142 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooLazy.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))143 return self.mockingContext.didInvoke(invocation) { () -> UseCaseInject.Foo in144 let implementation = self.stubbingContext.implementation(for: invocation)145 if let concreteImplementation = implementation as? () -> UseCaseInject.Foo {146 return concreteImplementation()147 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo).self) {148 return defaultValue149 } else {150 fatalError(self.stubbingContext.failTest(for: invocation))151 }152 }153 }154 set {155 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooLazy.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))156 self.mockingContext.didInvoke(invocation)157 let implementation = self.stubbingContext.implementation(for: invocation)158 if let concreteImplementation = implementation as? (UseCaseInject.Foo) -> Void {159 concreteImplementation(newValue)160 } else {161 (implementation as? () -> Void)?()162 }163 }164 }165 public func getFooLazy() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo> {166 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooLazy.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))167 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo>(mock: self, invocation: invocation)168 }169 public func setFooLazy(_ newValue: @escaping @autoclosure () -> UseCaseInject.Foo) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void> {170 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]171 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooLazy.set", arguments: arguments, returnType: Swift.ObjectIdentifier(Void.self))172 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void>(mock: self, invocation: invocation)173 }174 // MARK: Mocked fooOptional175 override public var `fooOptional`: UseCaseInject.Foo? {176 get {177 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooOptional.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo?).self))178 return self.mockingContext.didInvoke(invocation) { () -> UseCaseInject.Foo? in179 let implementation = self.stubbingContext.implementation(for: invocation)180 if let concreteImplementation = implementation as? () -> UseCaseInject.Foo? {181 return concreteImplementation()182 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo?).self) {183 return defaultValue184 } else {185 fatalError(self.stubbingContext.failTest(for: invocation))186 }187 }188 }189 set {190 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooOptional.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))191 self.mockingContext.didInvoke(invocation)192 let implementation = self.stubbingContext.implementation(for: invocation)193 if let concreteImplementation = implementation as? (UseCaseInject.Foo?) -> Void {194 concreteImplementation(newValue)195 } else {196 (implementation as? () -> Void)?()197 }198 }199 }...

Full Screen

Full Screen

UseCaseInject.generated.swift

Source:UseCaseInject.generated.swift Github

copy

Full Screen

...41 return concreteImplementation()42 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo).self) {43 return defaultValue44 } else {45 fatalError(self.stubbingContext.failTest(for: invocation))46 }47 }48 }49 set {50 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "foo.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))51 self.mockingContext.didInvoke(invocation)52 let implementation = self.stubbingContext.implementation(for: invocation)53 if let concreteImplementation = implementation as? (UseCaseInject.Foo) -> Void {54 concreteImplementation(newValue)55 } else {56 (implementation as? () -> Void)?()57 }58 }59 }60 public func getFoo() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo> {61 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "foo.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))62 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo>(mock: self, invocation: invocation)63 }64 public func setFoo(_ newValue: @escaping @autoclosure () -> UseCaseInject.Foo) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void> {65 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]66 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "foo.set", arguments: arguments, returnType: Swift.ObjectIdentifier(Void.self))67 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void>(mock: self, invocation: invocation)68 }69 // MARK: Mocked fooCustomInit70 override public var `fooCustomInit`: UseCaseInject.Foo {71 get {72 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooCustomInit.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))73 return self.mockingContext.didInvoke(invocation) { () -> UseCaseInject.Foo in74 let implementation = self.stubbingContext.implementation(for: invocation)75 if let concreteImplementation = implementation as? () -> UseCaseInject.Foo {76 return concreteImplementation()77 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo).self) {78 return defaultValue79 } else {80 fatalError(self.stubbingContext.failTest(for: invocation))81 }82 }83 }84 set {85 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooCustomInit.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))86 self.mockingContext.didInvoke(invocation)87 let implementation = self.stubbingContext.implementation(for: invocation)88 if let concreteImplementation = implementation as? (UseCaseInject.Foo) -> Void {89 concreteImplementation(newValue)90 } else {91 (implementation as? () -> Void)?()92 }93 }94 }95 public func getFooCustomInit() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo> {96 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooCustomInit.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))97 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo>(mock: self, invocation: invocation)98 }99 public func setFooCustomInit(_ newValue: @escaping @autoclosure () -> UseCaseInject.Foo) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void> {100 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]101 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooCustomInit.set", arguments: arguments, returnType: Swift.ObjectIdentifier(Void.self))102 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void>(mock: self, invocation: invocation)103 }104 // MARK: Mocked fooData105 override public var `fooData`: UseCaseInject.Foo {106 get {107 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooData.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))108 return self.mockingContext.didInvoke(invocation) { () -> UseCaseInject.Foo in109 let implementation = self.stubbingContext.implementation(for: invocation)110 if let concreteImplementation = implementation as? () -> UseCaseInject.Foo {111 return concreteImplementation()112 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo).self) {113 return defaultValue114 } else {115 fatalError(self.stubbingContext.failTest(for: invocation))116 }117 }118 }119 set {120 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooData.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))121 self.mockingContext.didInvoke(invocation)122 let implementation = self.stubbingContext.implementation(for: invocation)123 if let concreteImplementation = implementation as? (UseCaseInject.Foo) -> Void {124 concreteImplementation(newValue)125 } else {126 (implementation as? () -> Void)?()127 }128 }129 }130 public func getFooData() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo> {131 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooData.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))132 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo>(mock: self, invocation: invocation)133 }134 public func setFooData(_ newValue: @escaping @autoclosure () -> UseCaseInject.Foo) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void> {135 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]136 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooData.set", arguments: arguments, returnType: Swift.ObjectIdentifier(Void.self))137 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void>(mock: self, invocation: invocation)138 }139 // MARK: Mocked fooLazy140 override public var `fooLazy`: UseCaseInject.Foo {141 get {142 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooLazy.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))143 return self.mockingContext.didInvoke(invocation) { () -> UseCaseInject.Foo in144 let implementation = self.stubbingContext.implementation(for: invocation)145 if let concreteImplementation = implementation as? () -> UseCaseInject.Foo {146 return concreteImplementation()147 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo).self) {148 return defaultValue149 } else {150 fatalError(self.stubbingContext.failTest(for: invocation))151 }152 }153 }154 set {155 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooLazy.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))156 self.mockingContext.didInvoke(invocation)157 let implementation = self.stubbingContext.implementation(for: invocation)158 if let concreteImplementation = implementation as? (UseCaseInject.Foo) -> Void {159 concreteImplementation(newValue)160 } else {161 (implementation as? () -> Void)?()162 }163 }164 }165 public func getFooLazy() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo> {166 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooLazy.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo).self))167 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> UseCaseInject.Foo, UseCaseInject.Foo>(mock: self, invocation: invocation)168 }169 public func setFooLazy(_ newValue: @escaping @autoclosure () -> UseCaseInject.Foo) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void> {170 let arguments: [Mockingbird.ArgumentMatcher] = [Mockingbird.resolve(newValue)]171 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooLazy.set", arguments: arguments, returnType: Swift.ObjectIdentifier(Void.self))172 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (UseCaseInject.Foo) -> Void, Void>(mock: self, invocation: invocation)173 }174 // MARK: Mocked fooOptional175 override public var `fooOptional`: UseCaseInject.Foo? {176 get {177 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooOptional.get", arguments: [], returnType: Swift.ObjectIdentifier((UseCaseInject.Foo?).self))178 return self.mockingContext.didInvoke(invocation) { () -> UseCaseInject.Foo? in179 let implementation = self.stubbingContext.implementation(for: invocation)180 if let concreteImplementation = implementation as? () -> UseCaseInject.Foo? {181 return concreteImplementation()182 } else if let defaultValue = self.stubbingContext.defaultValueProvider.provideValue(for: (UseCaseInject.Foo?).self) {183 return defaultValue184 } else {185 fatalError(self.stubbingContext.failTest(for: invocation))186 }187 }188 }189 set {190 let invocation: Mockingbird.Invocation = Mockingbird.Invocation(selectorName: "fooOptional.set", arguments: [ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))191 self.mockingContext.didInvoke(invocation)192 let implementation = self.stubbingContext.implementation(for: invocation)193 if let concreteImplementation = implementation as? (UseCaseInject.Foo?) -> Void {194 concreteImplementation(newValue)195 } else {196 (implementation as? () -> Void)?()197 }198 }199 }...

Full Screen

Full Screen

failTest

Using AI Code Generation

copy

Full Screen

1let stubbingContext = StubbingContext()2stubbingContext.failTest("Error")3let stubbingContext = StubbingContext()4stubbingContext.failTest("Error")5let stubbingContext = StubbingContext()6stubbingContext.failTest("Error")7let stubbingContext = StubbingContext()8stubbingContext.failTest("Error")9let stubbingContext = StubbingContext()10stubbingContext.failTest("Error")11let stubbingContext = StubbingContext()12stubbingContext.failTest("Error")13let stubbingContext = StubbingContext()14stubbingContext.failTest("Error")15let stubbingContext = StubbingContext()16stubbingContext.failTest("Error")17let stubbingContext = StubbingContext()18stubbingContext.failTest("Error")19let stubbingContext = StubbingContext()20stubbingContext.failTest("Error")21let stubbingContext = StubbingContext()22stubbingContext.failTest("Error")23let stubbingContext = StubbingContext()24stubbingContext.failTest("Error")25let stubbingContext = StubbingContext()26stubbingContext.failTest("Error")27let stubbingContext = StubbingContext()28stubbingContext.failTest("Error")

Full Screen

Full Screen

failTest

Using AI Code Generation

copy

Full Screen

1func testFailTest() {2 let context = StubbingContext()3 context.failTest("test")4}5func testFailTest() {6 let context = StubbingContext()7 context.failTest("test")8}9func testFailTest() {10 let context = StubbingContext()11 context.failTest("test")12}13func testFailTest() {14 let context = StubbingContext()15 context.failTest("test")16}17func testFailTest() {18 let context = StubbingContext()19 context.failTest("test")20}21func testFailTest() {22 let context = StubbingContext()23 context.failTest("test")24}25func testFailTest() {26 let context = StubbingContext()27 context.failTest("test")28}29func testFailTest() {30 let context = StubbingContext()31 context.failTest("test")32}33func testFailTest() {34 let context = StubbingContext()35 context.failTest("test")36}37func testFailTest() {38 let context = StubbingContext()39 context.failTest("test")40}41func testFailTest() {42 let context = StubbingContext()43 context.failTest("test")44}45func testFailTest() {46 let context = StubbingContext()47 context.failTest("test")48}

Full Screen

Full Screen

failTest

Using AI Code Generation

copy

Full Screen

1import XCTest2class StubbingContext {3 init(testCase: XCTestCase) {4 }5 func failTest() {6 testCase.recordFailure(withDescription: "StubbingContext.failTest() called", inFile: "1.swift", atLine: 0, expected: false)7 }8}9import XCTest10class Tests: XCTestCase {11 func testExample() {12 let stubbingContext = StubbingContext(testCase: self)13 stubbingContext.failTest()14 }15}16import XCTest17class Tests: XCTestCase {18 func testExample() {19 let stubbingContext = StubbingContext(testCase: self)20 stubbingContext.failTest()21 }22}23import XCTest24class Tests: XCTestCase {25 func testExample() {26 let stubbingContext = StubbingContext(testCase: self)27 stubbingContext.failTest()28 }29}30import XCTest31class Tests: XCTestCase {32 func testExample() {33 let stubbingContext = StubbingContext(testCase: self)34 stubbingContext.failTest()35 }36}37import XCTest38class Tests: XCTestCase {39 func testExample() {40 let stubbingContext = StubbingContext(testCase: self)41 stubbingContext.failTest()42 }43}44import XCTest45class Tests: XCTestCase {46 func testExample() {47 let stubbingContext = StubbingContext(testCase: self)48 stubbingContext.failTest()49 }50}51import XCTest52class Tests: XCTestCase {53 func testExample() {54 let stubbingContext = StubbingContext(testCase: self)55 stubbingContext.failTest()56 }57}58import XCTest59class Tests: XCTestCase {60 func testExample() {61 let stubbingContext = StubbingContext(testCase: self)

Full Screen

Full Screen

failTest

Using AI Code Generation

copy

Full Screen

1import XCTest2import Mockingjay3class MockingjayTest: XCTestCase {4 func testMockingjay() {5 let stubbingContext = StubbingContext()6 stubbingContext.failTest = { error in7 XCTFail(error)8 }9 }10}11import XCTest12import Mockingjay13class MockingjayTest: XCTestCase {14 func testMockingjay() {15 let stubbingContext = StubbingContext()16 stubbingContext.failTest = { error in17 XCTFail(error)18 }19 }20}21import XCTest22import Mockingjay23class MockingjayTest: XCTestCase {24 func testMockingjay() {25 let stubbingContext = StubbingContext()26 stubbingContext.failTest = { error in27 XCTFail(error)28 }29 }30}31import XCTest32import Mockingjay33class MockingjayTest: XCTestCase {34 func testMockingjay() {35 let stubbingContext = StubbingContext()36 stubbingContext.failTest = { error in37 XCTFail(error)38 }39 }40}41import XCTest42import Mockingjay43class MockingjayTest: XCTestCase {

Full Screen

Full Screen

failTest

Using AI Code Generation

copy

Full Screen

1let stubbingContext = StubbingContext()2stubbingContext.failTest("some error message")3func testExample() {4 let stubbingContext = StubbingContext()5 stubbingContext.failTest("some error message")6}7let stubbingContext = StubbingContext()8stubbingContext.failTest("some error message")9func testExample() {10 let stubbingContext = StubbingContext()11 stubbingContext.failTest("some error message")12}13let stubbingContext = StubbingContext()14stubbingContext.failTest("some error message")15func testExample() {16 let stubbingContext = StubbingContext()17 stubbingContext.failTest("some error message")18}19let stubbingContext = StubbingContext()20stubbingContext.failTest("some error message")21func testExample() {22 let stubbingContext = StubbingContext()23 stubbingContext.failTest("some error message")24}25let stubbingContext = StubbingContext()26stubbingContext.failTest("some error message

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Mockingbird automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in StubbingContext

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful