mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 23:16:51 +00:00
* Fix bitmex order params * Fix insecure endpoint check * comment on Title funcs * tests for Title func * fix order_test Co-authored-by: Allie c( ⁰ 〰 ⁰ )੭ <88z@pm.me>
This commit is contained in:
@@ -92,7 +92,11 @@ func TestOrderSides(t *testing.T) {
|
||||
}
|
||||
|
||||
if os.Lower() != "buy" {
|
||||
t.Errorf("unexpected string %s", os.String())
|
||||
t.Errorf("unexpected string %s", os.Lower())
|
||||
}
|
||||
|
||||
if os.Title() != "Buy" {
|
||||
t.Errorf("unexpected string %s", os.Title())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +112,10 @@ func TestOrderTypes(t *testing.T) {
|
||||
if ot.Lower() != "mo'money" {
|
||||
t.Errorf("unexpected string %s", ot.Lower())
|
||||
}
|
||||
|
||||
if ot.Title() != "Mo'Money" {
|
||||
t.Errorf("unexpected string %s", ot.Title())
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterOrdersByType(t *testing.T) {
|
||||
|
||||
@@ -349,6 +349,11 @@ func (t Type) Lower() string {
|
||||
return strings.ToLower(string(t))
|
||||
}
|
||||
|
||||
// Title returns the type titleized, eg "Limit"
|
||||
func (t Type) Title() string {
|
||||
return strings.Title(strings.ToLower(string(t)))
|
||||
}
|
||||
|
||||
// String implements the stringer interface
|
||||
func (s Side) String() string {
|
||||
return string(s)
|
||||
@@ -359,6 +364,11 @@ func (s Side) Lower() string {
|
||||
return strings.ToLower(string(s))
|
||||
}
|
||||
|
||||
// Title returns the side titleized, eg "Buy"
|
||||
func (s Side) Title() string {
|
||||
return strings.Title(strings.ToLower(string(s)))
|
||||
}
|
||||
|
||||
// String implements the stringer interface
|
||||
func (s Status) String() string {
|
||||
return string(s)
|
||||
|
||||
Reference in New Issue
Block a user