tests for derivedcharger destinationids match

fixes #218
This commit is contained in:
Radu Ioan Fericean
2015-11-13 17:07:49 +02:00
parent 72c7df55d8
commit 34aee260b4

View File

@@ -18,15 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
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")
}
}