types: add TestPosition_SetClosing test

This commit is contained in:
c9s 2023-06-28 18:13:11 +08:00
parent 195ace63b0
commit 131345a762
No known key found for this signature in database

View File

@ -313,3 +313,15 @@ func TestPosition(t *testing.T) {
})
}
}
func TestPosition_SetClosing(t *testing.T) {
p := NewPosition("BTCUSDT", "BTC", "USDT")
ret := p.SetClosing(true)
assert.True(t, ret)
ret = p.SetClosing(true)
assert.False(t, ret)
ret = p.SetClosing(false)
assert.True(t, ret)
}