mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 21:59:53 +05:00
Testing engine.FSCdr.firstDefined function
This commit is contained in:
@@ -377,6 +377,7 @@ func TestSMAEventUpdateFromEvent(t *testing.T) {
|
||||
}
|
||||
*/
|
||||
|
||||
//Here
|
||||
func TestSMAEventAsSMGenericEvent(t *testing.T) {
|
||||
var ev map[string]interface{}
|
||||
if err := json.Unmarshal([]byte(stasisStart), &ev); err != nil {
|
||||
|
||||
@@ -525,3 +525,16 @@ func TestFsCdrDDazRSRExtraFields(t *testing.T) {
|
||||
t.Errorf("Unexpected effective_caller_id_number received: %+v", extraFields["effective_caller_id_number"])
|
||||
}
|
||||
}
|
||||
|
||||
func TestFsCdrFirstDefined(t *testing.T) {
|
||||
fsCdr, _ := NewFSCdr(body, fsCdrCfg)
|
||||
value := fsCdr.firstDefined([]string{utils.CGR_SUBJECT, utils.CGR_ACCOUNT, FS_USERNAME}, FsUsername)
|
||||
if value != "1001" {
|
||||
t.Errorf("Expecting: 1001, received: %s", value)
|
||||
}
|
||||
value = fsCdr.firstDefined([]string{utils.CGR_ACCOUNT, FS_USERNAME}, FsUsername)
|
||||
if value != "1001" {
|
||||
t.Errorf("Expecting: 1001, received: %s", value)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user