diff --git a/engine/handler_derivedcharging_test.go b/engine/handler_derivedcharging_test.go index 99061f5d3..83a4d2e54 100644 --- a/engine/handler_derivedcharging_test.go +++ b/engine/handler_derivedcharging_test.go @@ -18,15 +18,13 @@ along with this program. If not, see package engine -/* import ( - "reflect" "testing" - "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/utils" ) +/* var cfgDcT *config.CGRConfig var acntDb AccountingStorage @@ -94,3 +92,30 @@ func TestHandleGetStoredDC(t *testing.T) { } } */ + +func TestHandleDeivedChargersMatchDestRet(t *testing.T) { + dcs := &utils.DerivedChargers{ + DestinationIds: utils.NewStringMap("RET"), + } + if !DerivedChargersMatchesDest(dcs, "0723045326") { + t.Error("Derived charger failed to match dest") + } +} + +func TestHandleDeivedChargersMatchDestNat(t *testing.T) { + dcs := &utils.DerivedChargers{ + DestinationIds: utils.NewStringMap("NAT"), + } + if !DerivedChargersMatchesDest(dcs, "0723045326") { + t.Error("Derived charger failed to match dest") + } +} + +func TestHandleDeivedChargersMatchDestNatRet(t *testing.T) { + dcs := &utils.DerivedChargers{ + DestinationIds: utils.NewStringMap("NAT", "RET"), + } + if !DerivedChargersMatchesDest(dcs, "0723045326") { + t.Error("Derived charger failed to match dest") + } +}