修改测试用例的错误

This commit is contained in:
钱纯净
2024-11-04 23:54:28 +08:00
parent 8a3ebcec65
commit 39057e5305
4 changed files with 22 additions and 11 deletions

View File

@@ -10,10 +10,7 @@ import (
0c02000000011a001a003e05050000000000000002000030303030303101363030303038
*/
func TestNewSecurityQuotes(t *testing.T) {
f, err := MStockQuote.Frame(map[Exchange]string{
ExchangeSH: "000001",
ExchangeSZ: "600008",
})
f, err := MQuote.Frame("sz000001", "sh600008")
if err != nil {
t.Error(err)
return
@@ -48,12 +45,12 @@ func Test_getPrice(t *testing.T) {
0c020000000106000600500400000000
*/
func Test_securityList_Frame(t *testing.T) {
f := MStockList.Frame(ExchangeSH, 0)
f := MCode.Frame(ExchangeSH, 0)
t.Log(f.Bytes().HEX())
}
func Test_stockCount_Frame(t *testing.T) {
//预期0c0200000001080008004e04000075c73301
// 0c0000000001070007004e040075c73301
t.Log(MStockCount.Frame(ExchangeSH).Bytes().HEX())
t.Log(MCount.Frame(ExchangeSH).Bytes().HEX())
}

View File

@@ -2,14 +2,13 @@ package protocol
import (
"testing"
"time"
)
func Test_stockHistoryMinuteTrade_Frame(t *testing.T) {
// 预期 0c 02000000 00 1200 1200 b50f 84da3401 0000 30303030303100006400
// 0c000000000112001200b50f84da3401000030303030303100006400
f, err := MStockHistoryMinuteTrade.Frame(StockHistoryMinuteTradeReq{
Time: time.Date(2024, 10, 28, 0, 0, 0, 0, time.Local),
f, err := MHistoryMinuteTrade.Frame(HistoryMinuteTradeReq{
Date: "20241028",
Exchange: ExchangeSZ,
Code: "000001",
Start: 0,

View File

@@ -8,7 +8,7 @@ import (
func Test_stockKline_Frame(t *testing.T) {
//预期0c02000000001c001c002d050000303030303031 0900 0100 0000 0a00 00000000000000000000
// 0c00000000011c001c002d050000313030303030 0900 0000 0000 0a00 00000000000000000000
f, _ := MStockKline.Frame(TypeKlineDay, &StockKlineReq{
f, _ := MKline.Frame(TypeKlineDay, KlineReq{
Exchange: ExchangeSH,
Code: "000001",
Start: 0,
@@ -24,7 +24,7 @@ func Test_stockKline_Decode(t *testing.T) {
t.Error(err)
return
}
resp, err := MStockKline.Decode(bs, 9)
resp, err := MKline.Decode(bs, 9)
if err != nil {
t.Error(err)
return

View File

@@ -0,0 +1,15 @@
package protocol
import (
"testing"
)
func Test_quote_Frame(t *testing.T) {
//0c0000000001130013003e050500000000000000010000303030303031
f, err := MQuote.Frame("sz000001")
if err != nil {
t.Error(err)
return
}
t.Log(f.Bytes().HEX())
}