1 Star 0 Fork 0

muicx / quickfix

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
session_id_test.go 992 Bytes
一键复制 编辑 原始数据 按行查看 历史
package quickfix
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSessionID_String(t *testing.T) {
var testCases = []struct {
sessionID SessionID
expectedString string
}{
{SessionID{BeginString: "FIX.4.2", SenderCompID: "SND", TargetCompID: "TAR"}, "FIX.4.2:SND->TAR"},
{SessionID{BeginString: "FIX.4.2", SenderCompID: "SND", TargetCompID: "TAR", Qualifier: "BLAH"}, "FIX.4.2:SND->TAR:BLAH"},
{SessionID{BeginString: "FIX.4.2", SenderCompID: "SND", SenderSubID: "SSUB", SenderLocationID: "SLOC",
TargetCompID: "TAR", TargetSubID: "TSUB", TargetLocationID: "TLOC",
Qualifier: "BLAH"}, "FIX.4.2:SND/SSUB/SLOC->TAR/TSUB/TLOC:BLAH"},
{SessionID{BeginString: "FIX.4.2", SenderCompID: "SND", SenderLocationID: "SLOC",
TargetCompID: "TAR", TargetSubID: "TSUB", TargetLocationID: "TLOC",
}, "FIX.4.2:SND/SLOC->TAR/TSUB/TLOC"},
}
for _, tc := range testCases {
actual := tc.sessionID.String()
assert.Equal(t, tc.expectedString, actual)
}
}
Go
1
https://gitee.com/bradhuang/quickfixgo.git
git@gitee.com:bradhuang/quickfixgo.git
bradhuang
quickfixgo
quickfix
dependabot/go_modules/github.com/mattn/go-sqlite3-1.14.9

搜索帮助