How to use testStubReturnIUOValue_onProtocolMock_explicitSyntax method of StubbingTests class

Best Mockingbird code snippet using StubbingTests.testStubReturnIUOValue_onProtocolMock_explicitSyntax

Run Mockingbird automation tests on LambdaTest cloud grid

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

StubbingTests.swift

Source: StubbingTests.swift Github

copy
1import Mockingbird
2import XCTest
3@testable import MockingbirdTestsHost
4
5class StubbingTests: BaseTestCase {
6  
7  struct FakeError: Error {}
8  
9  var child: ChildMock!
10  var childInstance: Child { return child }
11  
12  var childProtocol: ChildProtocolMock!
13  var childProtocolInstance: ChildProtocol { return childProtocol }
14  
15  override func setUp() {
16    child = mock(Child.self)
17    childProtocol = mock(ChildProtocol.self)
18    reset(type(of: mock(ChildProtocol.self)))
19  }
20  
21  func testStubTrivialMethod_onClassMock_implicitlyStubbed() {
22    childInstance.childTrivialInstanceMethod()
23    verify(child.childTrivialInstanceMethod()).wasCalled()
24  }
25  func testStubTrivialMethod_onProtocolMock_implicitlyStubbed() {
26    childProtocolInstance.childTrivialInstanceMethod()
27    verify(childProtocol.childTrivialInstanceMethod()).wasCalled()
28  }
29  
30  func testStubTrivialMethod_onClassMock() {
31    given(child.childTrivialInstanceMethod()) ~> ()
32    childInstance.childTrivialInstanceMethod()
33    verify(child.childTrivialInstanceMethod()).wasCalled()
34  }
35  func testStubTrivialMethod_onProtocolMock() {
36    given(childProtocol.childTrivialInstanceMethod()) ~> ()
37    childProtocolInstance.childTrivialInstanceMethod()
38    verify(childProtocol.childTrivialInstanceMethod()).wasCalled()
39  }
40  
41  func testStubTrivialMethod_onClassMock_explicitSyntax() {
42    given(child.childTrivialInstanceMethod()).willReturn(())
43    childInstance.childTrivialInstanceMethod()
44    verify(child.childTrivialInstanceMethod()).wasCalled()
45  }
46  func testStubTrivialMethod_onProtocolMock_explicitSyntax() {
47    given(childProtocol.childTrivialInstanceMethod()).willReturn(())
48    childProtocolInstance.childTrivialInstanceMethod()
49    verify(childProtocol.childTrivialInstanceMethod()).wasCalled()
50  }
51  
52  func testStubTrivialMethod_onClassMock_convenienceExplicitSyntax() {
53    given(child.childTrivialInstanceMethod()).willReturn()
54    childInstance.childTrivialInstanceMethod()
55    verify(child.childTrivialInstanceMethod()).wasCalled()
56  }
57  func testStubTrivialMethod_onProtocolMock_convenienceExplicitSyntax() {
58    given(childProtocol.childTrivialInstanceMethod()).willReturn()
59    childProtocolInstance.childTrivialInstanceMethod()
60    verify(childProtocol.childTrivialInstanceMethod()).wasCalled()
61  }
62  
63  func testStubParameterizedMethodWithWildcardMatcher_onClassMock() {
64    given(child.childParameterizedInstanceMethod(param1: any(), any())) ~> true
65    XCTAssertTrue(childInstance.childParameterizedInstanceMethod(param1: true, 1))
66    verify(child.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
67    verify(child.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
68  }
69  func testStubParameterizedMethodWithWildcardMatcher_onProtocolMock() {
70    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any())) ~> true
71    XCTAssertTrue(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
72    verify(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
73    verify(childProtocol.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
74  }
75  
76  func testStubParameterizedMethodWithWildcardMatcher_onClassMock_explicitSyntax() {
77    given(child.childParameterizedInstanceMethod(param1: any(), any())).willReturn(true)
78    XCTAssertTrue(childInstance.childParameterizedInstanceMethod(param1: true, 1))
79    verify(child.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
80    verify(child.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
81  }
82  func testStubParameterizedMethodWithWildcardMatcher_onProtocolMock_explicitSyntax() {
83    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).willReturn(true)
84    XCTAssertTrue(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
85    verify(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
86    verify(childProtocol.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
87  }
88  
89  func testStubParameterizedMethodWithExactValue_onClassMock() {
90    given(child.childParameterizedInstanceMethod(param1: true, 1)) ~> true
91    XCTAssertTrue(childInstance.childParameterizedInstanceMethod(param1: true, 1))
92    verify(child.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
93  }
94  func testStubParameterizedMethodWithExactValue_onProtocolMock() {
95    given(childProtocol.childParameterizedInstanceMethod(param1: true, 1)) ~> true
96    XCTAssertTrue(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
97    verify(childProtocol.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
98  }
99  
100  func testStubParameterizedMethodWithExactValue_onClassMock_explicitSyntax() {
101    given(child.childParameterizedInstanceMethod(param1: true, 1)).willReturn(true)
102    XCTAssertTrue(childInstance.childParameterizedInstanceMethod(param1: true, 1))
103    verify(child.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
104  }
105  func testStubParameterizedMethodWithExactValue_onProtocolMock_explicitSyntax() {
106    given(childProtocol.childParameterizedInstanceMethod(param1: true, 1)).willReturn(true)
107    XCTAssertTrue(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
108    verify(childProtocol.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
109  }
110  
111  // MARK: Non-matching
112  
113  func testStubParameterizedMethodWithWildcardMatcher_doesNotMatch_onClassMock() {
114    shouldFail {
115      given(self.child.childParameterizedInstanceMethod(param1: any(), 1)) ~> true
116      XCTAssertTrue(self.childInstance.childParameterizedInstanceMethod(param1: true, 2))
117    }
118  }
119  func testStubParameterizedMethodWithWildcardMatcher_doesNotMatch_onProtocolMock() {
120    shouldFail {
121      given(self.childProtocol.childParameterizedInstanceMethod(param1: any(), 1)) ~> true
122      XCTAssertTrue(self.childProtocolInstance.childParameterizedInstanceMethod(param1: true, 2))
123    }
124  }
125  
126  func testStubParameterizedMethodWithWildcardMatcher_doesNotMatch_onClassMock_explicitSyntax() {
127    shouldFail {
128      given(self.child.childParameterizedInstanceMethod(param1: any(), 1)).willReturn(true)
129      XCTAssertTrue(self.childInstance.childParameterizedInstanceMethod(param1: true, 2))
130    }
131  }
132  func testStubParameterizedMethodWithWildcardMatcher_doesNotMatch_onProtocolMock_explicitSyntax() {
133    shouldFail {
134      given(self.childProtocol.childParameterizedInstanceMethod(param1: any(), 1)).willReturn(true)
135      XCTAssertTrue(self.childProtocolInstance.childParameterizedInstanceMethod(param1: true, 2))
136    }
137  }
138  
139  func testStubParameterizedMethodWithExactValue_doesNotMatch_onClassMock() {
140    shouldFail {
141      given(self.child.childParameterizedInstanceMethod(param1: true, 1)) ~> true
142      XCTAssertTrue(self.childInstance.childParameterizedInstanceMethod(param1: false, 1))
143    }
144  }
145  func testStubParameterizedMethodWithExactValue_doesNotMatch_onProtocolMock() {
146    shouldFail {
147      given(self.childProtocol.childParameterizedInstanceMethod(param1: true, 1)) ~> true
148      XCTAssertTrue(self.childProtocolInstance.childParameterizedInstanceMethod(param1: false, 1))
149    }
150  }
151  
152  func testStubParameterizedMethodWithExactValue_doesNotMatch_onClassMock_explicitSyntax() {
153    shouldFail {
154      given(self.child.childParameterizedInstanceMethod(param1: true, 1)).willReturn(true)
155      XCTAssertTrue(self.childInstance.childParameterizedInstanceMethod(param1: false, 1))
156    }
157  }
158  func testStubParameterizedMethodWithExactValue_doesNotMatch_onProtocolMock_explicitSyntax() {
159    shouldFail {
160      given(self.childProtocol.childParameterizedInstanceMethod(param1: true, 1)).willReturn(true)
161      XCTAssertTrue(self.childProtocolInstance.childParameterizedInstanceMethod(param1: false, 1))
162    }
163  }
164  
165  // MARK: Implicitly unwrapped optionals
166  
167  func testStubReturnIUOValue_onClassMock() {
168    let value: Bool! = true
169    given(child.getChildComputedInstanceVariable()) ~> value
170    XCTAssertTrue(childInstance.childComputedInstanceVariable)
171    verify(child.getChildComputedInstanceVariable()).wasCalled()
172  }
173  func testStubReturnIUOValue_onProtocolMock() {
174    let value: Bool! = true
175    given(childProtocol.getChildInstanceVariable()) ~> value
176    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
177    verify(childProtocol.getChildInstanceVariable()).wasCalled()
178  }
179  
180  func testStubReturnIUOValue_onClassMock_explicitSyntax() {
181    let value: Bool! = true
182    given(child.getChildComputedInstanceVariable()).willReturn(value)
183    XCTAssertTrue(childInstance.childComputedInstanceVariable)
184    verify(child.getChildComputedInstanceVariable()).wasCalled()
185  }
186  func testStubReturnIUOValue_onProtocolMock_explicitSyntax() {
187    let value: Bool! = true
188    given(childProtocol.getChildInstanceVariable()).willReturn(value)
189    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
190    verify(childProtocol.getChildInstanceVariable()).wasCalled()
191  }
192  
193  // MARK: Value consistency
194  
195  func testStubReturnValueReturnsSameValue_onClassMock() {
196    given(child.getChildComputedInstanceVariable()) ~> true
197    XCTAssertTrue(childInstance.childComputedInstanceVariable)
198    XCTAssertTrue(childInstance.childComputedInstanceVariable)
199    XCTAssertTrue(childInstance.childComputedInstanceVariable)
200    verify(child.getChildComputedInstanceVariable()).wasCalled(exactly(3))
201  }
202  func testStubReturnValueReturnsSameValue_onProtocolMock() {
203    given(childProtocol.getChildInstanceVariable()) ~> true
204    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
205    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
206    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
207    verify(childProtocol.getChildInstanceVariable()).wasCalled(exactly(3))
208  }
209  
210  func testStubReturnValueReturnsSameValue_onClassMock_explicitSyntax() {
211    given(child.getChildComputedInstanceVariable()).willReturn(true)
212    XCTAssertTrue(childInstance.childComputedInstanceVariable)
213    XCTAssertTrue(childInstance.childComputedInstanceVariable)
214    XCTAssertTrue(childInstance.childComputedInstanceVariable)
215    verify(child.getChildComputedInstanceVariable()).wasCalled(exactly(3))
216  }
217  func testStubReturnValueReturnsSameValue_onProtocolMock_explicitSyntax() {
218    given(childProtocol.getChildInstanceVariable()).willReturn(true)
219    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
220    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
221    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
222    verify(childProtocol.getChildInstanceVariable()).wasCalled(exactly(3))
223  }
224  
225  // MARK: Precedence
226  
227  func testStubParameterizedMethodOverridesPrevious_onClassMock() {
228    given(child.childParameterizedInstanceMethod(param1: any(), any())) ~> true
229    given(child.childParameterizedInstanceMethod(param1: any(), any())) ~> false
230    XCTAssertFalse(childInstance.childParameterizedInstanceMethod(param1: true, 1))
231    verify(child.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
232    verify(child.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
233  }
234  func testStubParameterizedMethodOverridesPrevious_onProtocolMock() {
235    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any())) ~> true
236    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any())) ~> false
237    XCTAssertFalse(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
238    verify(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
239    verify(childProtocol.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
240  }
241  
242  func testStubParameterizedMethodOverridesPrevious_onClassMock_explicitSyntax() {
243    given(child.childParameterizedInstanceMethod(param1: any(), any())).willReturn(true)
244    given(child.childParameterizedInstanceMethod(param1: any(), any())).willReturn(false)
245    XCTAssertFalse(childInstance.childParameterizedInstanceMethod(param1: true, 1))
246    verify(child.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
247    verify(child.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
248  }
249  func testStubParameterizedMethodOverridesPrevious_onProtocolMock_explicitSyntax() {
250    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).willReturn(true)
251    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).willReturn(false)
252    XCTAssertFalse(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
253    verify(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
254    verify(childProtocol.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
255  }
256  
257  func testStubParameterizedMethodIgnoresNonMatching_onClassMock() {
258    given(child.childParameterizedInstanceMethod(param1: any(), any())) ~> true
259    given(child.childParameterizedInstanceMethod(param1: any(), 100)) ~> false
260    XCTAssertTrue(childInstance.childParameterizedInstanceMethod(param1: true, 1))
261    verify(child.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
262    verify(child.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
263  }
264  func testStubParameterizedMethodIgnoresNonMatching_onProtocolMock() {
265    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any())) ~> true
266    given(childProtocol.childParameterizedInstanceMethod(param1: any(), 100)) ~> false
267    XCTAssertTrue(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
268    verify(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
269    verify(childProtocol.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
270  }
271  
272  func testStubParameterizedMethodIgnoresNonMatching_onClassMock_explicitSyntax() {
273    given(child.childParameterizedInstanceMethod(param1: any(), any())).willReturn(true)
274    given(child.childParameterizedInstanceMethod(param1: any(), 100)).willReturn(false)
275    XCTAssertTrue(childInstance.childParameterizedInstanceMethod(param1: true, 1))
276    verify(child.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
277    verify(child.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
278  }
279  func testStubParameterizedMethodIgnoresNonMatching_onProtocolMock_explicitSyntax() {
280    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).willReturn(true)
281    given(childProtocol.childParameterizedInstanceMethod(param1: any(), 100)).willReturn(false)
282    XCTAssertTrue(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
283    verify(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
284    verify(childProtocol.childParameterizedInstanceMethod(param1: true, 1)).wasCalled()
285  }
286  
287  // MARK: Clearing stubs
288  
289  func testClearStubs_onClassMock() {
290    shouldFail {
291      given(self.child.getChildStoredInstanceVariable()) ~> true
292      clearStubs(on: self.child)
293      XCTAssertTrue(self.child.childStoredInstanceVariable)
294    }
295  }
296  func testClearStubs_onProtocolMock() {
297    shouldFail {
298      given(self.childProtocol.getChildInstanceVariable()) ~> true
299      clearStubs(on: self.childProtocol)
300      XCTAssertTrue(self.child.childComputedInstanceVariable)
301    }
302  }
303  
304  func testClearStubs_onClassMock_explicitSyntax() {
305    shouldFail {
306      given(self.child.getChildStoredInstanceVariable()).willReturn(true)
307      clearStubs(on: self.child)
308      XCTAssertTrue(self.child.childStoredInstanceVariable)
309    }
310  }
311  func testClearStubs_onProtocolMock_explicitSyntax() {
312    shouldFail {
313      given(self.childProtocol.getChildInstanceVariable()).willReturn(true)
314      clearStubs(on: self.childProtocol)
315      XCTAssertTrue(self.child.childComputedInstanceVariable)
316    }
317  }
318  
319  // MARK: Closure implementation stubs
320  
321  func testStubParameterizedMethod_onClassMock_withExplicitlyTypedClosure() {
322    given(child.childParameterizedInstanceMethod(param1: any(), any())) ~> {
323      (param1: Bool, param2: Int) -> Bool in
324      return param1 && param2 == 1
325    }
326    XCTAssertTrue(childInstance.childParameterizedInstanceMethod(param1: true, 1))
327    verify(child.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
328  }
329  func testStubParameterizedMethod_onProtocolMock_withExplicitlyTypedClosure() {
330    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any())) ~> {
331      (param1: Bool, param2: Int) -> Bool in
332      return param1 && param2 == 1
333    }
334    XCTAssertTrue(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
335    verify(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
336  }
337  
338  func testStubParameterizedMethod_onClassMock_withImplicitlyTypedClosure() {
339    given(child.childParameterizedInstanceMethod(param1: any(), any()))
340      ~> { $0 && $1 == 1 }
341    XCTAssertTrue(childInstance.childParameterizedInstanceMethod(param1: true, 1))
342    verify(child.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
343  }
344  func testStubParameterizedMethod_onProtocolMock_withImplicitlyTypedClosure() {
345    given(childProtocol.childParameterizedInstanceMethod(param1: any(), any()))
346      ~> { $0 && $1 == 1 }
347    XCTAssertTrue(childProtocolInstance.childParameterizedInstanceMethod(param1: true, 1))
348    verify(childProtocol.childParameterizedInstanceMethod(param1: any(), any())).wasCalled()
349  }
350  
351  func testStubTrivialMethod_onClassMock_withExplicitClosure() {
352    given(child.childTrivialInstanceMethod()) ~> {}
353    childInstance.childTrivialInstanceMethod()
354    verify(child.childTrivialInstanceMethod()).wasCalled()
355  }
356  func testStubTrivialMethod_onProtocolMock_withExplicitClosure() {
357    given(childProtocol.childTrivialInstanceMethod()) ~> {}
358    childProtocolInstance.childTrivialInstanceMethod()
359    verify(childProtocol.childTrivialInstanceMethod()).wasCalled()
360  }
361  
362  func testStubNonParameterizedReturningMethod_onClassMock_withExplicitClosure() {
363    given(child.getChildComputedInstanceVariable()) ~> {true}
364    XCTAssertTrue(childInstance.childComputedInstanceVariable)
365    verify(child.getChildComputedInstanceVariable()).wasCalled()
366  }
367  func testStubNonParameterizedReturningMethod_onProtocolMock_withExplicitClosure() {
368    given(childProtocol.getChildInstanceVariable()) ~> {true}
369    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
370    verify(childProtocol.getChildInstanceVariable()).wasCalled()
371  }
372  
373  // MARK: Chained stubbing
374  
375  func testTransitionsToNextStub_afterCount() {
376    given(childProtocol.getChildInstanceVariable())
377      .willReturn(loopingSequence(of: true, false), transition: .after(4))
378      .willReturn(true)
379    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
380    XCTAssertFalse(childProtocolInstance.childInstanceVariable)
381    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
382    XCTAssertFalse(childProtocolInstance.childInstanceVariable)
383    
384    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
385    
386    // Check clamped to last value
387    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
388    
389    verify(childProtocol.getChildInstanceVariable()).wasCalled(exactly(6))
390  }
391  
392  func testTransitionsToNextStub_afterCount_skipsValueWhenStubbedLater() {
393    let stubbingManager = given(childProtocol.getChildInstanceVariable())
394      .willReturn(loopingSequence(of: false), transition: .after(2))
395    XCTAssertFalse(childProtocolInstance.childInstanceVariable)
396    XCTAssertFalse(childProtocolInstance.childInstanceVariable)
397    XCTAssertFalse(childProtocolInstance.childInstanceVariable) // Still using sequence value
398    
399    stubbingManager.willReturn(true)
400    XCTAssertTrue(childProtocolInstance.childInstanceVariable) // Should skip to latest stub
401    
402    // Check clamped to last value
403    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
404    
405    verify(childProtocol.getChildInstanceVariable()).wasCalled(exactly(5))
406  }
407  
408  func testTransitionsToNextStub_onFirstNil() {
409    given(childProtocol.getChildInstanceVariable())
410      .willReturn(finiteSequence(of: true, false))
411      .willReturn(true)
412    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
413    XCTAssertFalse(childProtocolInstance.childInstanceVariable)
414    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
415    
416    // Check clamped to last value
417    XCTAssertTrue(childProtocolInstance.childInstanceVariable)
418    
419    verify(childProtocol.getChildInstanceVariable()).wasCalled(exactly(4))
420  }
421  
422  // MARK: Static members
423  
424  func testStubStaticProperty() {
425    given(ChildProtocolMock.childStaticVariable).willReturn(true)
426    XCTAssertTrue(ChildProtocolMock.childStaticVariable)
427    verify(ChildProtocolMock.childStaticVariable).wasCalled()
428  }
429  
430  func testStubStaticMethod() {
431    given(ChildProtocolMock.childParameterizedStaticMethod(param1: any(), any())).willReturn(true)
432    XCTAssertTrue(ChildProtocolMock.childParameterizedStaticMethod(param1: true, 1))
433    verify(ChildProtocolMock.childParameterizedStaticMethod(param1: any(), any())).wasCalled()
434  }
435}
436
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Most used method in StubbingTests

Trigger testStubReturnIUOValue_onProtocolMock_explicitSyntax code on LambdaTest Cloud Grid

Execute automation tests with testStubReturnIUOValue_onProtocolMock_explicitSyntax on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)