首页 > 解决方案 > 模拟 GMSPlace

问题描述

我目前正在使用 Google Places,并创建了一个抽象的地点选择器,也是使用 Google Places 的具体实现。

我正在为它做一些单元测试。我来到了要模拟 GMSPlace 的步骤(https://developers.google.com/places/ios-sdk/reference/interface_g_m_s_place

问题是 GMSPlace 类的默认初始化不可用。

/**
 * Default init is not available.
 */
- (instancetype)init NS_UNAVAILABLE; 

有人可以分享我们如何在 init 不可用的情况下模拟事情吗?

谢谢

标签: iosswiftunit-testingmockinggoogle-places

解决方案


推荐阅读