mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 22:58:44 +05:00
Test AccountBalancesBackup func in utils/accountprofile.go
This commit is contained in:
committed by
Dan Christian Bogos
parent
14f3d31801
commit
9fc24e6a1a
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -355,3 +356,22 @@ func TestAP_RestoreFromBackup(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestAP_AccountBalancesBackup(t *testing.T) {
|
||||
actPrf := &AccountProfile{
|
||||
Balances: map[string]*Balance{
|
||||
"testKey": {
|
||||
Units: &Decimal{decimal.New(1234, 3)},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
actBk := actPrf.AccountBalancesBackup()
|
||||
for key, value := range actBk {
|
||||
if actPrf.Balances[key].Units.Big.Cmp(value) != 0 {
|
||||
fmt.Println(actPrf.Balances[key].Units.Big, value)
|
||||
t.Errorf("\ngot: <%+v>, \nwant: <%+v>", value, actPrf.Balances[key].Units.Big)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user