func CheckMsgsWithAll()

in golang/utils/CheckUtils.go [38:53]


func CheckMsgsWithAll(t *testing.T, sendMsgsCollector *SendMsgsCollector, recvMsgsCollector *RecvMsgsCollector) {
	assert.Equal(t, len(sendMsgsCollector.MsgIds), len(recvMsgsCollector.MsgIds), "they should be equal")
	for i, msg := range sendMsgsCollector.SendMsgs {
		var matchedMsgViews *rmq_client.MessageView
		for j, msgViews := range recvMsgsCollector.RecvMsgViews {
			if sendMsgsCollector.MsgIds[i] == msgViews.GetMessageId() {
				matchedMsgViews = recvMsgsCollector.RecvMsgViews[j]
				break
			}
		}
		assert.Equal(t, sendMsgsCollector.MsgIds[i], matchedMsgViews.GetMessageId(), "they should be equal")
		assert.Equal(t, msg.GetKeys(), matchedMsgViews.GetKeys(), "they should be equal")
		assert.Equal(t, msg.GetTag(), matchedMsgViews.GetTag(), "they should be equal")
		assert.Equal(t, msg.Body, matchedMsgViews.GetBody(), "they should be equal")
	}
}