Skip to content

Commit

Permalink
add Go client test - TestPlaceOrder (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify authored and wing328 committed Jun 14, 2018
1 parent 91d6d77 commit 7126074
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions samples/client/petstore/go/store_api_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"testing"
"time"

sw "./go-petstore"
"golang.org/x/net/context"
)

func TestPlaceOrder(t *testing.T) {
newOrder := sw.Order{
Id: 0,
PetId: 0,
Quantity: 0,
ShipDate: time.Now().UTC(),
Status: "placed",
Complete: false}

_, r, err := client.StoreApi.PlaceOrder(context.Background(), newOrder)

if err != nil {
t.Errorf("Error while placing order")
t.Log(err)
}
if r.StatusCode != 200 {
t.Log(r)
}
}

0 comments on commit 7126074

Please sign in to comment.