Skip to content

Commit a4a971c

Browse files
committed
added a test and recreated mock file
1 parent c7b460b commit a4a971c

File tree

2 files changed

+60
-29
lines changed

2 files changed

+60
-29
lines changed

playstore/mocks/playstore.go

+44-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playstore/validator_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,22 @@ func TestAcknowledgeProduct(t *testing.T) {
176176
// TODO Normal scenario
177177
}
178178

179+
func TestConsumeProduct(t *testing.T) {
180+
t.Parallel()
181+
// Exception scenario
182+
expected := "googleapi: Error 400: Invalid Value, invalid"
183+
184+
client, _ := New(jsonKey)
185+
ctx := context.Background()
186+
err := client.ConsumeProduct(ctx, "package", "productID", "purchaseToken")
187+
188+
if err == nil || err.Error() != expected {
189+
t.Errorf("got %v", err)
190+
}
191+
192+
// TODO Normal scenario
193+
}
194+
179195
func TestCancelSubscription(t *testing.T) {
180196
t.Parallel()
181197
ctx := context.Background()

0 commit comments

Comments
 (0)