我正在尝试为我的网络调用编写失败的测试,但无论如何都无法从我的测试中找到访问连接设置的方法。此代码适用于测试成功案例:functestRetrieveProducts(){letexpectation=expectationWithDescription("asynchronousrequest")Requests().retrieveProducts({(products)->()in//checkthatwehavetwoarraysreturned.XCTAssert(products.count==2)expectation.fulfill()}){(error)->()inX