mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-19 22:28:45 +05:00
22 lines
499 B
Go
22 lines
499 B
Go
package engine
|
|
|
|
import "testing"
|
|
|
|
func TestModelHelperCsvLoad(t *testing.T) {
|
|
l := csvLoad(TpDestination{}, []string{"TEST_DEST", "+492"})
|
|
tpd := l.(TpDestination)
|
|
if tpd.Tag != "TEST_DEST" || tpd.Prefix != "+492" {
|
|
t.Errorf("model load failed: %+v", tpd)
|
|
}
|
|
}
|
|
|
|
func TestModelHelperCsvDump(t *testing.T) {
|
|
tpd := &TpDestination{
|
|
Tag: "TEST_DEST",
|
|
Prefix: "+492"}
|
|
csv, err := csvDump(*tpd, ",")
|
|
if err != nil || csv != "TEST_DEST,+492" {
|
|
t.Errorf("model load failed: %+v", tpd)
|
|
}
|
|
}
|