mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Test Sort for balances in utils/accountprofile.go
This commit is contained in:
committed by
Dan Christian Bogos
parent
bd55e86c84
commit
36aa85d842
@@ -408,7 +408,7 @@ func TestAPNewDefaultBalance(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestAPSort(t *testing.T) {
|
||||
func TestAPApsSort(t *testing.T) {
|
||||
|
||||
apS := AccountProfilesWithWeight{
|
||||
{
|
||||
@@ -612,3 +612,34 @@ func TestAPTenantIDs(t *testing.T) {
|
||||
t.Errorf("\nReceived: <%v>, \nExpected: <%+v>", received, expected)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAPBlcsSort(t *testing.T) {
|
||||
|
||||
blncS := BalancesWithWeight{
|
||||
{
|
||||
Weight: 2,
|
||||
},
|
||||
{
|
||||
Weight: 1,
|
||||
},
|
||||
{
|
||||
Weight: 3,
|
||||
},
|
||||
}
|
||||
expected := BalancesWithWeight{
|
||||
{
|
||||
Weight: 3,
|
||||
},
|
||||
{
|
||||
Weight: 2,
|
||||
},
|
||||
{
|
||||
Weight: 1,
|
||||
},
|
||||
}
|
||||
|
||||
blncS.Sort()
|
||||
if !reflect.DeepEqual(blncS, expected) {
|
||||
t.Errorf("\nReceived: <%+v>, \nExpected: <%+v>", ToJSON(blncS), ToJSON(expected))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user