mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-01 07:26:48 +00:00
committed by
Adrian Gallagher
parent
242b02c382
commit
63a9e9fcb1
37
exchanges/order/orders_test.go
Normal file
37
exchanges/order/orders_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package order
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewOrder(t *testing.T) {
|
||||
ID := NewOrder("ANX", 2000, 20.00)
|
||||
if ID != 0 {
|
||||
t.Error("Orders_test.go NewOrder() - Error")
|
||||
}
|
||||
ID = NewOrder("BATMAN", 400, 25.00)
|
||||
if ID != 1 {
|
||||
t.Error("Orders_test.go NewOrder() - Error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeleteOrder(t *testing.T) {
|
||||
if value := DeleteOrder(0); !value {
|
||||
t.Error("Orders_test.go DeleteOrder() - Error")
|
||||
}
|
||||
if value := DeleteOrder(100); value {
|
||||
t.Error("Orders_test.go DeleteOrder() - Error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetOrdersByExchange(t *testing.T) {
|
||||
if value := GetOrdersByExchange("ANX"); len(value) != 0 {
|
||||
t.Error("Orders_test.go GetOrdersByExchange() - Error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetOrderByOrderID(t *testing.T) {
|
||||
if value := GetOrderByOrderID(69); value != nil {
|
||||
t.Error("Orders_test.go GetOrdersByExchange() - Error")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user