Engine QA - Order update (#372)

Engine QA - Order update
This commit is contained in:
Ryan O'Hara-Reid
2019-10-30 14:06:48 +11:00
committed by Adrian Gallagher
parent 242b02c382
commit 63a9e9fcb1
89 changed files with 3077 additions and 2876 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/thrasher-corp/gocryptotrader/common"
"github.com/thrasher-corp/gocryptotrader/currency"
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
"github.com/thrasher-corp/gocryptotrader/exchanges/order"
"github.com/thrasher-corp/gocryptotrader/exchanges/sharedtestvalues"
"github.com/thrasher-corp/gocryptotrader/exchanges/websocket/wshandler"
)
@@ -343,8 +344,8 @@ func TestFormatWithdrawPermissions(t *testing.T) {
func TestGetActiveOrders(t *testing.T) {
t.Parallel()
var getOrdersRequest = exchange.GetOrdersRequest{
OrderType: exchange.AnyOrderType,
var getOrdersRequest = order.GetOrdersRequest{
OrderType: order.AnyType,
Currencies: []currency.Pair{
currency.NewPair(currency.LTC, currency.BTC),
},
@@ -363,8 +364,8 @@ func TestGetActiveOrders(t *testing.T) {
func TestGetOrderHistory(t *testing.T) {
t.Parallel()
var getOrdersRequest = exchange.GetOrdersRequest{
OrderType: exchange.AnyOrderType,
var getOrdersRequest = order.GetOrdersRequest{
OrderType: order.AnyType,
Currencies: []currency.Pair{currency.NewPair(currency.LTC, currency.BTC)},
}
@@ -391,14 +392,14 @@ func TestSubmitOrder(t *testing.T) {
t.Skip("API keys set, canManipulateRealOrders false, skipping test")
}
var orderSubmission = &exchange.OrderSubmission{
var orderSubmission = &order.Submit{
Pair: currency.Pair{
Delimiter: "_",
Base: currency.LTC,
Quote: currency.BTC,
},
OrderSide: exchange.BuyOrderSide,
OrderType: exchange.LimitOrderType,
OrderSide: order.Buy,
OrderType: order.Limit,
Price: 10,
Amount: 1,
ClientID: "1234234",
@@ -421,7 +422,7 @@ func TestCancelExchangeOrder(t *testing.T) {
t.Skip("API keys set, canManipulateRealOrders false, skipping test")
}
var orderCancellation = &exchange.OrderCancellation{
var orderCancellation = &order.Cancel{
OrderID: "266029865",
}
@@ -444,7 +445,7 @@ func TestCancelAllExchangeOrders(t *testing.T) {
currencyPair := currency.NewPair(currency.LTC, currency.BTC)
var orderCancellation = &exchange.OrderCancellation{
var orderCancellation = &order.Cancel{
OrderID: "1",
WalletAddress: "1F5zVDgNjorJ51oGebSvNCrSAHpwGkUdDB",
AccountID: "1",
@@ -461,14 +462,14 @@ func TestCancelAllExchangeOrders(t *testing.T) {
t.Errorf("Could not cancel orders: %v", err)
}
if len(resp.OrderStatus) > 0 {
t.Errorf("%v orders failed to cancel", len(resp.OrderStatus))
if len(resp.Status) > 0 {
t.Errorf("%v orders failed to cancel", len(resp.Status))
}
}
func TestModifyOrder(t *testing.T) {
t.Parallel()
_, err := g.ModifyOrder(&exchange.ModifyOrder{})
_, err := g.ModifyOrder(&order.Modify{})
if err == nil {
t.Error("ModifyOrder() Expected error")
}