mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 13:49:53 +05:00
22 lines
530 B
Go
22 lines
530 B
Go
package engine
|
|
|
|
import "testing"
|
|
|
|
func TestModelHelperCsvLoad(t *testing.T) {
|
|
l, err := csvLoad(TpDestination{}, []string{"TEST_DEST", "+492"})
|
|
tpd := l.(TpDestination)
|
|
if err != nil || 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[0] != "TEST_DEST" || csv[1] != "+492" {
|
|
t.Errorf("model load failed: %+v", tpd)
|
|
}
|
|
}
|