forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
orders_test.go
37 lines (32 loc) · 907 Bytes
/
orders_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"testing"
)
func TestNewOrder(t *testing.T) {
ID := NewOrder("ANX", 2000, 20.00)
if ID != 0 {
t.Error("Test Failed - Orders_test.go NewOrder() - Error")
}
ID = NewOrder("BATMAN", 400, 25.00)
if ID != 1 {
t.Error("Test Failed - Orders_test.go NewOrder() - Error")
}
}
func TestDeleteOrder(t *testing.T) {
if value := DeleteOrder(0); !value {
t.Error("Test Failed - Orders_test.go DeleteOrder() - Error")
}
if value := DeleteOrder(100); value {
t.Error("Test Failed - Orders_test.go DeleteOrder() - Error")
}
}
func TestGetOrdersByExchange(t *testing.T) {
if value := GetOrdersByExchange("ANX"); len(value) != 0 {
t.Error("Test Failed - Orders_test.go GetOrdersByExchange() - Error")
}
}
func TestGetOrderByOrderID(t *testing.T) {
if value := GetOrderByOrderID(69); value != nil {
t.Error("Test Failed - Orders_test.go GetOrdersByExchange() - Error")
}
}