mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Test Usage func in utils/aptpdata.go
This commit is contained in:
committed by
Dan Christian Bogos
parent
bf6533c7b8
commit
ee642fcc1a
@@ -1237,3 +1237,20 @@ func TestBalanceUnitFactor(t *testing.T) {
|
||||
t.Errorf("Expected %+v, received %+v", expected, rcv)
|
||||
}
|
||||
}
|
||||
|
||||
func TestATDUsage(t *testing.T) {
|
||||
args := &ArgsCostForEvent{
|
||||
CGREvent: &CGREvent{
|
||||
ID: "testID",
|
||||
Event: map[string]interface{}{
|
||||
Usage: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
_, err := args.Usage()
|
||||
expected := "cannot convert field: true to time.Duration"
|
||||
if err == nil || err.Error() != expected {
|
||||
t.Errorf("\nReceived: <%+v>, \nExpected: <%+v>", err.Error(), expected)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user