Test Sort for balances in utils/accountprofile.go

This commit is contained in:
ionutboangiu
2021-03-04 17:12:06 +02:00
committed by Dan Christian Bogos
parent bd55e86c84
commit 36aa85d842

View File

@@ -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))
}
}