Skip to content

Commit 449c967

Browse files
committed
Add GeneratedFakeable conformance to Customer model
1 parent 6fb5ee4 commit 449c967

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Fakes/Fakes/Networking.generated.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,20 @@ extension CreateProductVariation {
181181
)
182182
}
183183
}
184+
extension Customer {
185+
/// Returns a "ready to use" type filled with fake values.
186+
///
187+
static func fake() -> Customer {
188+
.init(
189+
customerID: .fake(),
190+
email: .fake(),
191+
firstName: .fake(),
192+
lastName: .fake(),
193+
billing: .fake(),
194+
shipping: .fake()
195+
)
196+
}
197+
}
184198
extension DotcomError {
185199
/// Returns a "ready to use" type filled with fake values.
186200
///

Networking/Networking/Model/Customer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Codegen
44
/// Represents a Customer entity:
55
/// https://woocommerce.github.io/woocommerce-rest-api-docs/#customer-properties
66
///
7-
struct Customer: Codable, GeneratedCopiable {
7+
struct Customer: Codable, GeneratedCopiable, GeneratedFakeable {
88

99
/// Unique identifier for the customer
1010
let customerID: Int64

0 commit comments

Comments
 (0)