How to use recordInvocation method of Context class

Best Mockingbird code snippet using Context.recordInvocation

HomePresentationTests-HomeApplicationMocks.generated.swift

Source:HomePresentationTests-HomeApplicationMocks.generated.swift Github

copy

Full Screen

...23 }24 // MARK: Mocked `articles`()25 public func `articles`() -> Observable<HomeApplication.ArticlesAuthorsLikes> {26 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`articles`() -> Observable<HomeApplication.ArticlesAuthorsLikes>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<HomeApplication.ArticlesAuthorsLikes>).self))) {27 self.mockingbirdContext.recordInvocation($0)28 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)29 if let mkbImpl = mkbImpl as? () -> Observable<HomeApplication.ArticlesAuthorsLikes> { return mkbImpl() }30 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {31 switch mkbTargetBox.target {32 case .super:33 break34 case .object(let mkbObject):35 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }36 let mkbValue: Observable<HomeApplication.ArticlesAuthorsLikes> = mkbObject.`articles`()37 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)38 return mkbValue39 }40 }41 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Observable<HomeApplication.ArticlesAuthorsLikes>).self) { return mkbValue }42 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)43 }44 }45 public func `articles`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<HomeApplication.ArticlesAuthorsLikes>, Observable<HomeApplication.ArticlesAuthorsLikes>> {46 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<HomeApplication.ArticlesAuthorsLikes>, Observable<HomeApplication.ArticlesAuthorsLikes>>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`articles`() -> Observable<HomeApplication.ArticlesAuthorsLikes>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<HomeApplication.ArticlesAuthorsLikes>).self)))47 }48}49/// Returns a concrete mock of `GetArticlesSource`.50public func mock(_ type: HomeApplication.GetArticlesSource.Protocol, file: StaticString = #file, line: UInt = #line) -> GetArticlesSourceMock {51 return GetArticlesSourceMock(sourceLocation: Mockingbird.SourceLocation(file, line))52}53// MARK: - Mocked GetArticles54public final class GetArticlesMock: HomeApplication.GetArticles, Mockingbird.Mock {55 typealias MockingbirdSupertype = HomeApplication.GetArticles56 public static let mockingbirdContext = Mockingbird.Context()57 public let mockingbirdContext = Mockingbird.Context(["generator_version": "0.20.0", "module_name": "HomeApplication"])58 public enum InitializerProxy {59 public static func initialize(__file: StaticString = #file, __line: UInt = #line) -> GetArticlesMock {60 let mock: GetArticlesMock = GetArticlesMock()61 mock.mockingbirdContext.sourceLocation = SourceLocation(__file, __line)62 return mock63 }64 }65 // MARK: Mocked mapper66 override public var `mapper`: HomeApplication.ArticlesMapper {67 get {68 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "mapper.getter", setterSelectorName: "mapper.setter", selectorType: Mockingbird.SelectorType.getter, arguments: [], returnType: Swift.ObjectIdentifier((HomeApplication.ArticlesMapper).self))) {69 self.mockingbirdContext.recordInvocation($0)70 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)71 if let mkbImpl = mkbImpl as? () -> HomeApplication.ArticlesMapper { return mkbImpl() }72 if let mkbImpl = mkbImpl as? () -> Any { return Mockingbird.dynamicCast(mkbImpl()) as HomeApplication.ArticlesMapper }73 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {74 switch mkbTargetBox.target {75 case .super:76 return super.`mapper`77 case .object(let mkbObject):78 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }79 let mkbValue: HomeApplication.ArticlesMapper = mkbObject.`mapper`80 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)81 return mkbValue82 }83 }84 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (HomeApplication.ArticlesMapper).self) { return mkbValue }85 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)86 }87 }88 set {89 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "mapper.setter", setterSelectorName: "mapper.setter", selectorType: Mockingbird.SelectorType.setter, arguments: [Mockingbird.ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))) {90 self.mockingbirdContext.recordInvocation($0)91 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)92 if let mkbImpl = mkbImpl as? (HomeApplication.ArticlesMapper) -> Void { return mkbImpl(newValue) }93 if let mkbImpl = mkbImpl as? () -> Void { return mkbImpl() }94 if let mkbImpl = mkbImpl as? (Any?) -> Any { return Mockingbird.dynamicCast(mkbImpl(newValue as Any?)) as Void }95 if let mkbImpl = mkbImpl as? () -> Any { return Mockingbird.dynamicCast(mkbImpl()) as Void }96 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {97 switch mkbTargetBox.target {98 case .super:99 return super.`mapper` = newValue100 case .object(let mkbObject):101 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }102 let mkbValue: Void = mkbObject.`mapper` = newValue103 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)104 return mkbValue105 }106 }107 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Void).self) { return mkbValue }108 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)109 }110 }111 }112 public func getMapper() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> HomeApplication.ArticlesMapper, HomeApplication.ArticlesMapper> {113 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> HomeApplication.ArticlesMapper, HomeApplication.ArticlesMapper>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "mapper.getter", setterSelectorName: "mapper.setter", selectorType: Mockingbird.SelectorType.getter, arguments: [], returnType: Swift.ObjectIdentifier((HomeApplication.ArticlesMapper).self)))114 }115 public func setMapper(_ newValue: @autoclosure () -> HomeApplication.ArticlesMapper) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (HomeApplication.ArticlesMapper) -> Void, Void> {116 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (HomeApplication.ArticlesMapper) -> Void, Void>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "mapper.setter", setterSelectorName: "mapper.setter", selectorType: Mockingbird.SelectorType.setter, arguments: [Mockingbird.resolve(newValue)], returnType: Swift.ObjectIdentifier(Void.self)))117 }118 // MARK: Mocked source119 override public var `source`: HomeApplication.GetArticlesSource {120 get {121 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "source.getter", setterSelectorName: "source.setter", selectorType: Mockingbird.SelectorType.getter, arguments: [], returnType: Swift.ObjectIdentifier((HomeApplication.GetArticlesSource).self))) {122 self.mockingbirdContext.recordInvocation($0)123 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)124 if let mkbImpl = mkbImpl as? () -> HomeApplication.GetArticlesSource { return mkbImpl() }125 if let mkbImpl = mkbImpl as? () -> Any { return Mockingbird.dynamicCast(mkbImpl()) as HomeApplication.GetArticlesSource }126 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {127 switch mkbTargetBox.target {128 case .super:129 return super.`source`130 case .object(let mkbObject):131 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }132 let mkbValue: HomeApplication.GetArticlesSource = mkbObject.`source`133 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)134 return mkbValue135 }136 }137 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (HomeApplication.GetArticlesSource).self) { return mkbValue }138 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)139 }140 }141 set {142 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "source.setter", setterSelectorName: "source.setter", selectorType: Mockingbird.SelectorType.setter, arguments: [Mockingbird.ArgumentMatcher(newValue)], returnType: Swift.ObjectIdentifier(Void.self))) {143 self.mockingbirdContext.recordInvocation($0)144 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)145 if let mkbImpl = mkbImpl as? (HomeApplication.GetArticlesSource) -> Void { return mkbImpl(newValue) }146 if let mkbImpl = mkbImpl as? () -> Void { return mkbImpl() }147 if let mkbImpl = mkbImpl as? (Any?) -> Any { return Mockingbird.dynamicCast(mkbImpl(newValue as Any?)) as Void }148 if let mkbImpl = mkbImpl as? () -> Any { return Mockingbird.dynamicCast(mkbImpl()) as Void }149 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {150 switch mkbTargetBox.target {151 case .super:152 return super.`source` = newValue153 case .object(let mkbObject):154 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }155 let mkbValue: Void = mkbObject.`source` = newValue156 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)157 return mkbValue158 }159 }160 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Void).self) { return mkbValue }161 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)162 }163 }164 }165 public func getSource() -> Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> HomeApplication.GetArticlesSource, HomeApplication.GetArticlesSource> {166 return Mockingbird.Mockable<Mockingbird.PropertyGetterDeclaration, () -> HomeApplication.GetArticlesSource, HomeApplication.GetArticlesSource>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "source.getter", setterSelectorName: "source.setter", selectorType: Mockingbird.SelectorType.getter, arguments: [], returnType: Swift.ObjectIdentifier((HomeApplication.GetArticlesSource).self)))167 }168 public func setSource(_ newValue: @autoclosure () -> HomeApplication.GetArticlesSource) -> Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (HomeApplication.GetArticlesSource) -> Void, Void> {169 return Mockingbird.Mockable<Mockingbird.PropertySetterDeclaration, (HomeApplication.GetArticlesSource) -> Void, Void>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "source.setter", setterSelectorName: "source.setter", selectorType: Mockingbird.SelectorType.setter, arguments: [Mockingbird.resolve(newValue)], returnType: Swift.ObjectIdentifier(Void.self)))170 }171 // MARK: Mocked `articles`()172 public override func `articles`() -> Observable<[HomeApplication.Article]> {173 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`articles`() -> Observable<[HomeApplication.Article]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[HomeApplication.Article]>).self))) {174 self.mockingbirdContext.recordInvocation($0)175 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)176 if let mkbImpl = mkbImpl as? () -> Observable<[HomeApplication.Article]> { return mkbImpl() }177 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {178 switch mkbTargetBox.target {179 case .super:180 return super.`articles`()181 case .object(let mkbObject):182 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }183 let mkbValue: Observable<[HomeApplication.Article]> = mkbObject.`articles`()184 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)185 return mkbValue186 }187 }188 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Observable<[HomeApplication.Article]>).self) { return mkbValue }189 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)190 }191 }192 public func `articles`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[HomeApplication.Article]>, Observable<[HomeApplication.Article]>> {193 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[HomeApplication.Article]>, Observable<[HomeApplication.Article]>>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`articles`() -> Observable<[HomeApplication.Article]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[HomeApplication.Article]>).self)))194 }195 // MARK: Mocked init()196 public required override init() {197 super.init()198 self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "init()", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Void).self)))199 }200 public func initialize() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Void, Void> {201 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Void, Void>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "init()", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Void).self)))202 }203}204/// Returns an abstract mock which should be initialized using `mock(GetArticles.self).initialize(…)`.205public func mock(_ type: HomeApplication.GetArticles.Type, file: StaticString = #file, line: UInt = #line) -> GetArticlesMock.InitializerProxy.Type {206 return GetArticlesMock.InitializerProxy.self207}208// MARK: - Mocked LikeArticleSource209public final class LikeArticleSourceMock: HomeApplication.LikeArticleSource, Mockingbird.Mock {210 typealias MockingbirdSupertype = HomeApplication.LikeArticleSource211 public static let mockingbirdContext = Mockingbird.Context()212 public let mockingbirdContext = Mockingbird.Context(["generator_version": "0.20.0", "module_name": "HomeApplication"])213 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {214 self.mockingbirdContext.sourceLocation = sourceLocation215 LikeArticleSourceMock.mockingbirdContext.sourceLocation = sourceLocation216 }217 // MARK: Mocked `findArticle`(`id`: String)218 public func `findArticle`(`id`: String) -> Observable<HomeApplication.ArticlesAuthorsLikes> {219 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`findArticle`(`id`: String) -> Observable<HomeApplication.ArticlesAuthorsLikes>", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`id`)], returnType: Swift.ObjectIdentifier((Observable<HomeApplication.ArticlesAuthorsLikes>).self))) {220 self.mockingbirdContext.recordInvocation($0)221 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)222 if let mkbImpl = mkbImpl as? (String) -> Observable<HomeApplication.ArticlesAuthorsLikes> { return mkbImpl(`id`) }223 if let mkbImpl = mkbImpl as? () -> Observable<HomeApplication.ArticlesAuthorsLikes> { return mkbImpl() }224 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {225 switch mkbTargetBox.target {226 case .super:227 break228 case .object(let mkbObject):229 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }230 let mkbValue: Observable<HomeApplication.ArticlesAuthorsLikes> = mkbObject.`findArticle`(id: `id`)231 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)232 return mkbValue233 }234 }235 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Observable<HomeApplication.ArticlesAuthorsLikes>).self) { return mkbValue }236 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)237 }238 }239 public func `findArticle`(`id`: @autoclosure () -> String) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (String) -> Observable<HomeApplication.ArticlesAuthorsLikes>, Observable<HomeApplication.ArticlesAuthorsLikes>> {240 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (String) -> Observable<HomeApplication.ArticlesAuthorsLikes>, Observable<HomeApplication.ArticlesAuthorsLikes>>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`findArticle`(`id`: String) -> Observable<HomeApplication.ArticlesAuthorsLikes>", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.resolve(`id`)], returnType: Swift.ObjectIdentifier((Observable<HomeApplication.ArticlesAuthorsLikes>).self)))241 }242 // MARK: Mocked `updateArticle`(`articlePlain`: HomeApplication.ArticlePlain)243 public func `updateArticle`(`articlePlain`: HomeApplication.ArticlePlain) -> Void {244 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`updateArticle`(`articlePlain`: HomeApplication.ArticlePlain) -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`articlePlain`)], returnType: Swift.ObjectIdentifier((Void).self))) {245 self.mockingbirdContext.recordInvocation($0)246 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)247 if let mkbImpl = mkbImpl as? (HomeApplication.ArticlePlain) -> Void { return mkbImpl(`articlePlain`) }248 if let mkbImpl = mkbImpl as? () -> Void { return mkbImpl() }249 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {250 switch mkbTargetBox.target {251 case .super:252 break253 case .object(let mkbObject):254 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }255 let mkbValue: Void = mkbObject.`updateArticle`(articlePlain: `articlePlain`)256 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)257 return mkbValue258 }259 }...

Full Screen

Full Screen

HomeDataTests-HomeDataMocks.generated.swift

Source:HomeDataTests-HomeDataMocks.generated.swift Github

copy

Full Screen

...24 }25 // MARK: Mocked `findArticle`(`id`: String)26 public func `findArticle`(`id`: String) -> HomeApplication.ArticlePlain {27 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`findArticle`(`id`: String) -> HomeApplication.ArticlePlain", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`id`)], returnType: Swift.ObjectIdentifier((HomeApplication.ArticlePlain).self))) {28 self.mockingbirdContext.recordInvocation($0)29 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)30 if let mkbImpl = mkbImpl as? (String) -> HomeApplication.ArticlePlain { return mkbImpl(`id`) }31 if let mkbImpl = mkbImpl as? () -> HomeApplication.ArticlePlain { return mkbImpl() }32 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {33 switch mkbTargetBox.target {34 case .super:35 break36 case .object(let mkbObject):37 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }38 let mkbValue: HomeApplication.ArticlePlain = mkbObject.`findArticle`(id: `id`)39 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)40 return mkbValue41 }42 }43 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (HomeApplication.ArticlePlain).self) { return mkbValue }44 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)45 }46 }47 public func `findArticle`(`id`: @autoclosure () -> String) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (String) -> HomeApplication.ArticlePlain, HomeApplication.ArticlePlain> {48 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (String) -> HomeApplication.ArticlePlain, HomeApplication.ArticlePlain>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`findArticle`(`id`: String) -> HomeApplication.ArticlePlain", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.resolve(`id`)], returnType: Swift.ObjectIdentifier((HomeApplication.ArticlePlain).self)))49 }50 // MARK: Mocked `streamAllArticles`()51 public func `streamAllArticles`() -> Observable<[HomeApplication.ArticlePlain]> {52 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`streamAllArticles`() -> Observable<[HomeApplication.ArticlePlain]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[HomeApplication.ArticlePlain]>).self))) {53 self.mockingbirdContext.recordInvocation($0)54 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)55 if let mkbImpl = mkbImpl as? () -> Observable<[HomeApplication.ArticlePlain]> { return mkbImpl() }56 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {57 switch mkbTargetBox.target {58 case .super:59 break60 case .object(let mkbObject):61 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }62 let mkbValue: Observable<[HomeApplication.ArticlePlain]> = mkbObject.`streamAllArticles`()63 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)64 return mkbValue65 }66 }67 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Observable<[HomeApplication.ArticlePlain]>).self) { return mkbValue }68 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)69 }70 }71 public func `streamAllArticles`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[HomeApplication.ArticlePlain]>, Observable<[HomeApplication.ArticlePlain]>> {72 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[HomeApplication.ArticlePlain]>, Observable<[HomeApplication.ArticlePlain]>>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`streamAllArticles`() -> Observable<[HomeApplication.ArticlePlain]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[HomeApplication.ArticlePlain]>).self)))73 }74 // MARK: Mocked `updateArticle`(`plain`: HomeApplication.ArticlePlain)75 public func `updateArticle`(`plain`: HomeApplication.ArticlePlain) -> Void {76 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`updateArticle`(`plain`: HomeApplication.ArticlePlain) -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`plain`)], returnType: Swift.ObjectIdentifier((Void).self))) {77 self.mockingbirdContext.recordInvocation($0)78 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)79 if let mkbImpl = mkbImpl as? (HomeApplication.ArticlePlain) -> Void { return mkbImpl(`plain`) }80 if let mkbImpl = mkbImpl as? () -> Void { return mkbImpl() }81 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {82 switch mkbTargetBox.target {83 case .super:84 break85 case .object(let mkbObject):86 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }87 let mkbValue: Void = mkbObject.`updateArticle`(plain: `plain`)88 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)89 return mkbValue90 }91 }92 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Void).self) { return mkbValue }93 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)94 }95 }96 public func `updateArticle`(`plain`: @autoclosure () -> HomeApplication.ArticlePlain) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (HomeApplication.ArticlePlain) -> Void, Void> {97 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (HomeApplication.ArticlePlain) -> Void, Void>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`updateArticle`(`plain`: HomeApplication.ArticlePlain) -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.resolve(`plain`)], returnType: Swift.ObjectIdentifier((Void).self)))98 }99}100/// Returns a concrete mock of `ArticleDataSourceLocal`.101public func mock(_ type: HomeData.ArticleDataSourceLocal.Protocol, file: StaticString = #file, line: UInt = #line) -> ArticleDataSourceLocalMock {102 return ArticleDataSourceLocalMock(sourceLocation: Mockingbird.SourceLocation(file, line))103}104// MARK: - Mocked ArticleDataSourceRemote105public final class ArticleDataSourceRemoteMock: HomeData.ArticleDataSourceRemote, Mockingbird.Mock {106 typealias MockingbirdSupertype = HomeData.ArticleDataSourceRemote107 public static let mockingbirdContext = Mockingbird.Context()108 public let mockingbirdContext = Mockingbird.Context(["generator_version": "0.20.0", "module_name": "HomeData"])109 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {110 self.mockingbirdContext.sourceLocation = sourceLocation111 ArticleDataSourceRemoteMock.mockingbirdContext.sourceLocation = sourceLocation112 }113 // MARK: Mocked `fetchArticles`()114 public func `fetchArticles`() -> Observable<[HomeApplication.ArticlePlain]> {115 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`fetchArticles`() -> Observable<[HomeApplication.ArticlePlain]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[HomeApplication.ArticlePlain]>).self))) {116 self.mockingbirdContext.recordInvocation($0)117 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)118 if let mkbImpl = mkbImpl as? () -> Observable<[HomeApplication.ArticlePlain]> { return mkbImpl() }119 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {120 switch mkbTargetBox.target {121 case .super:122 break123 case .object(let mkbObject):124 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }125 let mkbValue: Observable<[HomeApplication.ArticlePlain]> = mkbObject.`fetchArticles`()126 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)127 return mkbValue128 }129 }130 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Observable<[HomeApplication.ArticlePlain]>).self) { return mkbValue }131 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)132 }133 }134 public func `fetchArticles`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[HomeApplication.ArticlePlain]>, Observable<[HomeApplication.ArticlePlain]>> {135 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[HomeApplication.ArticlePlain]>, Observable<[HomeApplication.ArticlePlain]>>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`fetchArticles`() -> Observable<[HomeApplication.ArticlePlain]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[HomeApplication.ArticlePlain]>).self)))136 }137 // MARK: Mocked `updateArticleToServer`(`plain`: HomeApplication.ArticlePlain)138 public func `updateArticleToServer`(`plain`: HomeApplication.ArticlePlain) -> Void {139 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`updateArticleToServer`(`plain`: HomeApplication.ArticlePlain) -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`plain`)], returnType: Swift.ObjectIdentifier((Void).self))) {140 self.mockingbirdContext.recordInvocation($0)141 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)142 if let mkbImpl = mkbImpl as? (HomeApplication.ArticlePlain) -> Void { return mkbImpl(`plain`) }143 if let mkbImpl = mkbImpl as? () -> Void { return mkbImpl() }144 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {145 switch mkbTargetBox.target {146 case .super:147 break148 case .object(let mkbObject):149 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }150 let mkbValue: Void = mkbObject.`updateArticleToServer`(plain: `plain`)151 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)152 return mkbValue153 }154 }155 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Void).self) { return mkbValue }156 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)157 }158 }159 public func `updateArticleToServer`(`plain`: @autoclosure () -> HomeApplication.ArticlePlain) -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (HomeApplication.ArticlePlain) -> Void, Void> {160 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, (HomeApplication.ArticlePlain) -> Void, Void>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`updateArticleToServer`(`plain`: HomeApplication.ArticlePlain) -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.resolve(`plain`)], returnType: Swift.ObjectIdentifier((Void).self)))161 }162}163/// Returns a concrete mock of `ArticleDataSourceRemote`.164public func mock(_ type: HomeData.ArticleDataSourceRemote.Protocol, file: StaticString = #file, line: UInt = #line) -> ArticleDataSourceRemoteMock {165 return ArticleDataSourceRemoteMock(sourceLocation: Mockingbird.SourceLocation(file, line))166}167// MARK: - Mocked AuthorDataSourceLocal168public final class AuthorDataSourceLocalMock: HomeData.AuthorDataSourceLocal, Mockingbird.Mock {169 typealias MockingbirdSupertype = HomeData.AuthorDataSourceLocal170 public static let mockingbirdContext = Mockingbird.Context()171 public let mockingbirdContext = Mockingbird.Context(["generator_version": "0.20.0", "module_name": "HomeData"])172 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {173 self.mockingbirdContext.sourceLocation = sourceLocation174 AuthorDataSourceLocalMock.mockingbirdContext.sourceLocation = sourceLocation175 }176 // MARK: Mocked `findAuthors`()177 public func `findAuthors`() -> Observable<[HomeApplication.AuthorPlain]> {178 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`findAuthors`() -> Observable<[HomeApplication.AuthorPlain]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[HomeApplication.AuthorPlain]>).self))) {179 self.mockingbirdContext.recordInvocation($0)180 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)181 if let mkbImpl = mkbImpl as? () -> Observable<[HomeApplication.AuthorPlain]> { return mkbImpl() }182 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {183 switch mkbTargetBox.target {184 case .super:185 break186 case .object(let mkbObject):187 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }188 let mkbValue: Observable<[HomeApplication.AuthorPlain]> = mkbObject.`findAuthors`()189 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)190 return mkbValue191 }192 }193 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Observable<[HomeApplication.AuthorPlain]>).self) { return mkbValue }194 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)195 }196 }197 public func `findAuthors`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[HomeApplication.AuthorPlain]>, Observable<[HomeApplication.AuthorPlain]>> {198 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[HomeApplication.AuthorPlain]>, Observable<[HomeApplication.AuthorPlain]>>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`findAuthors`() -> Observable<[HomeApplication.AuthorPlain]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[HomeApplication.AuthorPlain]>).self)))199 }200}201/// Returns a concrete mock of `AuthorDataSourceLocal`.202public func mock(_ type: HomeData.AuthorDataSourceLocal.Protocol, file: StaticString = #file, line: UInt = #line) -> AuthorDataSourceLocalMock {203 return AuthorDataSourceLocalMock(sourceLocation: Mockingbird.SourceLocation(file, line))204}205// MARK: - Mocked LikesDataSourceLocal206public final class LikesDataSourceLocalMock: HomeData.LikesDataSourceLocal, Mockingbird.Mock {207 typealias MockingbirdSupertype = HomeData.LikesDataSourceLocal208 public static let mockingbirdContext = Mockingbird.Context()209 public let mockingbirdContext = Mockingbird.Context(["generator_version": "0.20.0", "module_name": "HomeData"])210 fileprivate init(sourceLocation: Mockingbird.SourceLocation) {211 self.mockingbirdContext.sourceLocation = sourceLocation212 LikesDataSourceLocalMock.mockingbirdContext.sourceLocation = sourceLocation213 }214 // MARK: Mocked `findLikedArticles`()215 public func `findLikedArticles`() -> Observable<[String]> {216 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`findLikedArticles`() -> Observable<[String]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[String]>).self))) {217 self.mockingbirdContext.recordInvocation($0)218 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)219 if let mkbImpl = mkbImpl as? () -> Observable<[String]> { return mkbImpl() }220 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {221 switch mkbTargetBox.target {222 case .super:223 break224 case .object(let mkbObject):225 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }226 let mkbValue: Observable<[String]> = mkbObject.`findLikedArticles`()227 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)228 return mkbValue229 }230 }231 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Observable<[String]>).self) { return mkbValue }232 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)233 }234 }235 public func `findLikedArticles`() -> Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[String]>, Observable<[String]>> {236 return Mockingbird.Mockable<Mockingbird.FunctionDeclaration, () -> Observable<[String]>, Observable<[String]>>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`findLikedArticles`() -> Observable<[String]>", selectorType: Mockingbird.SelectorType.method, arguments: [], returnType: Swift.ObjectIdentifier((Observable<[String]>).self)))237 }238 // MARK: Mocked `saveLikedArticle`(`id`: String)239 public func `saveLikedArticle`(`id`: String) -> Void {240 return self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`saveLikedArticle`(`id`: String) -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`id`)], returnType: Swift.ObjectIdentifier((Void).self))) {241 self.mockingbirdContext.recordInvocation($0)242 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)243 if let mkbImpl = mkbImpl as? (String) -> Void { return mkbImpl(`id`) }244 if let mkbImpl = mkbImpl as? () -> Void { return mkbImpl() }245 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {246 switch mkbTargetBox.target {247 case .super:248 break249 case .object(let mkbObject):250 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }251 let mkbValue: Void = mkbObject.`saveLikedArticle`(id: `id`)252 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)253 return mkbValue254 }255 }...

Full Screen

Full Screen

JwtApiClientMocks.generated.swift

Source:JwtApiClientMocks.generated.swift Github

copy

Full Screen

...32 }33 // MARK: Mocked `delete`(`url`: URL, `token`: String)34 public override func `delete`(`url`: URL, `token`: String) async throws -> Void {35 return try await self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`delete`(`url`: URL, `token`: String) async throws -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`url`), Mockingbird.ArgumentMatcher(`token`)], returnType: Swift.ObjectIdentifier((Void).self))) {36 self.mockingbirdContext.recordInvocation($0)37 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)38 if let mkbImpl = mkbImpl as? (URL, String) async throws -> Void { return try await mkbImpl(`url`, `token`) }39 if let mkbImpl = mkbImpl as? () async throws -> Void { return try await mkbImpl() }40 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {41 switch mkbTargetBox.target {42 case .super:43 return try await super.`delete`(url: `url`, token: `token`)44 case .object(let mkbObject):45 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }46 let mkbValue: Void = try await mkbObject.`delete`(url: `url`, token: `token`)47 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)48 return mkbValue49 }50 }51 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Void).self) { return mkbValue }52 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)53 }54 }55 public func `delete`(`url`: @autoclosure () -> URL, `token`: @autoclosure () -> String) async -> Mockingbird.Mockable<Mockingbird.ThrowingAsyncFunctionDeclaration, (URL, String) async throws -> Void, Void> {56 return Mockingbird.Mockable<Mockingbird.ThrowingAsyncFunctionDeclaration, (URL, String) async throws -> Void, Void>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`delete`(`url`: URL, `token`: String) async throws -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.resolve(`url`), Mockingbird.resolve(`token`)], returnType: Swift.ObjectIdentifier((Void).self)))57 }58 // MARK: Mocked `patch`(`url`: URL, `dictionary`: [String: Any], `token`: String)59 public override func `patch`(`url`: URL, `dictionary`: [String: Any], `token`: String) async throws -> Void {60 return try await self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`patch`(`url`: URL, `dictionary`: [String: Any], `token`: String) async throws -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`url`), Mockingbird.ArgumentMatcher(`dictionary`), Mockingbird.ArgumentMatcher(`token`)], returnType: Swift.ObjectIdentifier((Void).self))) {61 self.mockingbirdContext.recordInvocation($0)62 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)63 if let mkbImpl = mkbImpl as? (URL, [String: Any], String) async throws -> Void { return try await mkbImpl(`url`, `dictionary`, `token`) }64 if let mkbImpl = mkbImpl as? () async throws -> Void { return try await mkbImpl() }65 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {66 switch mkbTargetBox.target {67 case .super:68 return try await super.`patch`(url: `url`, dictionary: `dictionary`, token: `token`)69 case .object(let mkbObject):70 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }71 let mkbValue: Void = try await mkbObject.`patch`(url: `url`, dictionary: `dictionary`, token: `token`)72 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)73 return mkbValue74 }75 }76 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (Void).self) { return mkbValue }77 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)78 }79 }80 public func `patch`(`url`: @autoclosure () -> URL, `dictionary`: @autoclosure () -> [String: Any], `token`: @autoclosure () -> String) async -> Mockingbird.Mockable<Mockingbird.ThrowingAsyncFunctionDeclaration, (URL, [String: Any], String) async throws -> Void, Void> {81 return Mockingbird.Mockable<Mockingbird.ThrowingAsyncFunctionDeclaration, (URL, [String: Any], String) async throws -> Void, Void>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`patch`(`url`: URL, `dictionary`: [String: Any], `token`: String) async throws -> Void", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.resolve(`url`), Mockingbird.resolve(`dictionary`), Mockingbird.resolve(`token`)], returnType: Swift.ObjectIdentifier((Void).self)))82 }83 // MARK: Mocked `get`<T>(`url`: URL, `token`: String)84 public override func `get`<T>(`url`: URL, `token`: String) async throws -> T where T: Decodable {85 return try await self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`get`<T>(`url`: URL, `token`: String) async throws -> T where T: Decodable", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`url`), Mockingbird.ArgumentMatcher(`token`)], returnType: Swift.ObjectIdentifier((T).self))) {86 self.mockingbirdContext.recordInvocation($0)87 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)88 if let mkbImpl = mkbImpl as? (URL, String) async throws -> T { return try await mkbImpl(`url`, `token`) }89 if let mkbImpl = mkbImpl as? () async throws -> T { return try await mkbImpl() }90 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {91 switch mkbTargetBox.target {92 case .super:93 return try await super.`get`(url: `url`, token: `token`)94 case .object(let mkbObject):95 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }96 let mkbValue: T = try await mkbObject.`get`(url: `url`, token: `token`)97 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)98 return mkbValue99 }100 }101 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (T).self) { return mkbValue }102 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)103 }104 }105 public func `get`<T>(`url`: @autoclosure () -> URL, `token`: @autoclosure () -> String) async -> Mockingbird.Mockable<Mockingbird.ThrowingAsyncFunctionDeclaration, (URL, String) async throws -> T, T> where T: Decodable {106 return Mockingbird.Mockable<Mockingbird.ThrowingAsyncFunctionDeclaration, (URL, String) async throws -> T, T>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`get`<T>(`url`: URL, `token`: String) async throws -> T where T: Decodable", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.resolve(`url`), Mockingbird.resolve(`token`)], returnType: Swift.ObjectIdentifier((T).self)))107 }108 // MARK: Mocked `post`<T>(`url`: URL, `dictionary`: [String: Any])109 public override func `post`<T>(`url`: URL, `dictionary`: [String: Any]) async throws -> T where T: Decodable {110 return try await self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`post`<T>(`url`: URL, `dictionary`: [String: Any]) async throws -> T where T: Decodable", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`url`), Mockingbird.ArgumentMatcher(`dictionary`)], returnType: Swift.ObjectIdentifier((T).self))) {111 self.mockingbirdContext.recordInvocation($0)112 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)113 if let mkbImpl = mkbImpl as? (URL, [String: Any]) async throws -> T { return try await mkbImpl(`url`, `dictionary`) }114 if let mkbImpl = mkbImpl as? () async throws -> T { return try await mkbImpl() }115 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {116 switch mkbTargetBox.target {117 case .super:118 return try await super.`post`(url: `url`, dictionary: `dictionary`)119 case .object(let mkbObject):120 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }121 let mkbValue: T = try await mkbObject.`post`(url: `url`, dictionary: `dictionary`)122 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)123 return mkbValue124 }125 }126 if let mkbValue = self.mockingbirdContext.stubbing.defaultValueProvider.value.provideValue(for: (T).self) { return mkbValue }127 self.mockingbirdContext.stubbing.failTest(for: $0, at: self.mockingbirdContext.sourceLocation)128 }129 }130 public func `post`<T>(`url`: @autoclosure () -> URL, `dictionary`: @autoclosure () -> [String: Any]) async -> Mockingbird.Mockable<Mockingbird.ThrowingAsyncFunctionDeclaration, (URL, [String: Any]) async throws -> T, T> where T: Decodable {131 return Mockingbird.Mockable<Mockingbird.ThrowingAsyncFunctionDeclaration, (URL, [String: Any]) async throws -> T, T>(context: self.mockingbirdContext, invocation: Mockingbird.SwiftInvocation(selectorName: "`post`<T>(`url`: URL, `dictionary`: [String: Any]) async throws -> T where T: Decodable", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.resolve(`url`), Mockingbird.resolve(`dictionary`)], returnType: Swift.ObjectIdentifier((T).self)))132 }133 // MARK: Mocked `post`<T>(`url`: URL, `dictionary`: [String: Any], `token`: String)134 public override func `post`<T>(`url`: URL, `dictionary`: [String: Any], `token`: String) async throws -> T where T: Decodable {135 return try await self.mockingbirdContext.mocking.didInvoke(Mockingbird.SwiftInvocation(selectorName: "`post`<T>(`url`: URL, `dictionary`: [String: Any], `token`: String) async throws -> T where T: Decodable", selectorType: Mockingbird.SelectorType.method, arguments: [Mockingbird.ArgumentMatcher(`url`), Mockingbird.ArgumentMatcher(`dictionary`), Mockingbird.ArgumentMatcher(`token`)], returnType: Swift.ObjectIdentifier((T).self))) {136 self.mockingbirdContext.recordInvocation($0)137 let mkbImpl = self.mockingbirdContext.stubbing.implementation(for: $0)138 if let mkbImpl = mkbImpl as? (URL, [String: Any], String) async throws -> T { return try await mkbImpl(`url`, `dictionary`, `token`) }139 if let mkbImpl = mkbImpl as? () async throws -> T { return try await mkbImpl() }140 for mkbTargetBox in self.mockingbirdContext.proxy.targets(for: $0) {141 switch mkbTargetBox.target {142 case .super:143 return try await super.`post`(url: `url`, dictionary: `dictionary`, token: `token`)144 case .object(let mkbObject):145 guard var mkbObject = mkbObject as? MockingbirdSupertype else { break }146 let mkbValue: T = try await mkbObject.`post`(url: `url`, dictionary: `dictionary`, token: `token`)147 self.mockingbirdContext.proxy.updateTarget(&mkbObject, in: mkbTargetBox)148 return mkbValue149 }150 }...

Full Screen

Full Screen

recordInvocation

Using AI Code Generation

copy

Full Screen

1import Foundation2class Context {3 init(name: String) {4 }5 func recordInvocation() {6 }7}8let context = Context(name: "MyContext")9context.recordInvocation()10print("Invocation count: \(context.invocationCount)")11import Foundation12class Context {13 init(name: String) {14 }15 func recordInvocation() {16 }17}18let context = Context(name: "MyContext")19context.recordInvocation()20print("Invocation count: \(context.invocationCount)")21import Foundation22class Context {23 init(name: String) {24 }25 func recordInvocation() {26 }27}28let context = Context(name: "MyContext")29context.recordInvocation()30print("Invocation count: \(context.invocationCount)")31import Foundation32class Context {33 init(name: String) {34 }35 func recordInvocation() {36 }37}38let context = Context(name: "MyContext")39context.recordInvocation()40print("Invocation count: \(context.invocationCount)")41import Foundation42class Context {43 init(name: String) {44 }45 func recordInvocation() {46 }47}48let context = Context(name: "MyContext")49context.recordInvocation()50print("Invocation count: \(context.invocationCount)")51import Foundation52class Context {

Full Screen

Full Screen

recordInvocation

Using AI Code Generation

copy

Full Screen

1import Foundation2class Context {3 init(name: String) {4 }5 func recordInvocation() {6 print("recordInvocation method is called")7 }8}9let context = Context(name: "Context")10context.recordInvocation()11An extension adds new functionality to an existing class, structure, enumeration, or protocol type. This includes the ability to extend types for which you do not have access to the original source code (known as retroactive modeling). Extensions are similar to categories in Objective-C. (Unlike Objective-C categories, Swift extensions do not have names.)12extension SomeType {13}14extension SomeType: SomeProtocol, AnotherProtocol {15}16import Foundation17extension String {18 func toInt() -> Int? {19 return Int(self)20 }21}22if let num = str.toInt() {23 print(num)24}25protocol SomeProtocol {26}27import Foundation28protocol MyProtocol {29 func myMethod()30}31class MyClass: MyProtocol {32 func myMethod() {33 print("myMethod is called")34 }35}36let obj = MyClass()37obj.myMethod()38enum SomeEnumeration {39}40import Foundation

Full Screen

Full Screen

recordInvocation

Using AI Code Generation

copy

Full Screen

1let context = Context()2let recorder = Recorder()3context.recordInvocation(recorder)4context.invoke()5print(recorder.invocationCount)6let context = Context()7let recorder = Recorder()8context.recordInvocation(recorder)9context.invoke()10print(recorder.invocationCount)11let context = Context()12let recorder = Recorder()13context.recordInvocation(recorder)14context.invoke()15print(recorder.invocationCount)16let context = Context()17let recorder = Recorder()18context.recordInvocation(recorder)19context.invoke()20print(recorder.invocationCount)21let context = Context()22let recorder = Recorder()23context.recordInvocation(recorder)24context.invoke()25print(recorder.invocationCount)26let context = Context()27let recorder = Recorder()28context.recordInvocation(recorder)29context.invoke()30print(recorder.invocationCount)31let context = Context()32let recorder = Recorder()33context.recordInvocation(recorder)34context.invoke()35print(recorder.invocationCount)36let context = Context()37let recorder = Recorder()38context.recordInvocation(recorder)39context.invoke()40print(recorder.invocationCount)41let context = Context()42let recorder = Recorder()43context.recordInvocation(recorder)44context.invoke()45print(recorder.invocationCount)46let context = Context()47let recorder = Recorder()48context.recordInvocation(recorder)49context.invoke()50print(recorder.invocationCount)51let context = Context()52let recorder = Recorder()53context.recordInvocation(recorder)54context.invoke()55print(recorder.invocationCount)56let context = Context()57let recorder = Recorder()58context.recordInvocation(rec

Full Screen

Full Screen

recordInvocation

Using AI Code Generation

copy

Full Screen

1import Foundation2class Context {3 var invocationArray = [String]()4 func recordInvocation(_ invocation: String) {5 invocationArray.append(invocation)6 }7}8let context = Context()9context.recordInvocation("Hello")10import Foundation11class Context {12 var invocationArray = [String]()13 func recordInvocation(_ invocation: String) {14 invocationArray.append(invocation)15 }16}17let context = Context()18import Foundation19class Context {20 var invocationArray = [String]()21 func recordInvocation(_ invocation: String) {22 invocationArray.append(invocation)23 }24}25let context = Context()26context.recordInvocation("Hello")27context.recordInvocation("World")28import Foundation29class Context {30 var invocationArray = [String]()31 func recordInvocation(_ invocation: String) {32 invocationArray.append(invocation)33 }34}35let context = Context()36context.recordInvocation("Hello")37context.recordInvocation("World")38context.recordInvocation("Hello")39context.recordInvocation("World")40import Foundation41class Context {42 var invocationArray = [String]()43 func recordInvocation(_ invocation: String) {44 invocationArray.append(invocation)45 }46}47let context = Context()48context.recordInvocation("Hello")49context.recordInvocation("World")50context.recordInvocation("Hello")51context.recordInvocation("World")52context.recordInvocation("Hello")53context.recordInvocation("World")54import Foundation55class Context {56 var invocationArray = [String]()57 func recordInvocation(_ invocation: String) {58 invocationArray.append(invocation)59 }60}61let context = Context()62context.recordInvocation("Hello")63context.recordInvocation("World")64context.recordInvocation("

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 Context

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful