mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 08:08:45 +05:00
dc exclude destination test
This commit is contained in:
@@ -119,3 +119,21 @@ func TestHandleDeivedChargersMatchDestNatRet(t *testing.T) {
|
||||
t.Error("Derived charger failed to match dest")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleDeivedChargersMatchDestSpec(t *testing.T) {
|
||||
dcs := &utils.DerivedChargers{
|
||||
DestinationIDs: utils.NewStringMap("NAT", "SPEC"),
|
||||
}
|
||||
if !DerivedChargersMatchesDest(dcs, "0723045326") {
|
||||
t.Error("Derived charger failed to match dest")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleDeivedChargersMatchDestNegativeSpec(t *testing.T) {
|
||||
dcs := &utils.DerivedChargers{
|
||||
DestinationIDs: utils.NewStringMap("NAT", "!SPEC"),
|
||||
}
|
||||
if DerivedChargersMatchesDest(dcs, "0723045326") {
|
||||
t.Error("Derived charger failed to match dest")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ func TestHistoryDestinations(t *testing.T) {
|
||||
{"Id":"PSTN_71","Prefixes":["+4971"]},
|
||||
{"Id":"PSTN_72","Prefixes":["+4972"]},
|
||||
{"Id":"RET","Prefixes":["0723","0724"]},
|
||||
{"Id":"SPEC","Prefixes":["0723045"]},
|
||||
{"Id":"URG","Prefixes":["112"]}`
|
||||
if !strings.Contains(buf.String(), expected) {
|
||||
t.Error("Error in destination history content:", buf.String())
|
||||
|
||||
@@ -42,6 +42,7 @@ NAT,0723
|
||||
NAT,+49
|
||||
RET,0723
|
||||
RET,0724
|
||||
SPEC,0723045
|
||||
PSTN_71,+4971
|
||||
PSTN_72,+4972
|
||||
PSTN_70,+4970
|
||||
@@ -319,7 +320,7 @@ func init() {
|
||||
}
|
||||
|
||||
func TestLoadDestinations(t *testing.T) {
|
||||
if len(csvr.destinations) != 12 {
|
||||
if len(csvr.destinations) != 13 {
|
||||
t.Error("Failed to load destinations: ", len(csvr.destinations))
|
||||
}
|
||||
for _, d := range csvr.destinations {
|
||||
|
||||
Reference in New Issue
Block a user