Updated tests in account

This commit is contained in:
adragusin
2019-11-20 09:42:13 +02:00
committed by Dan Christian Bogos
parent af5cf967b4
commit 1db6f91ad5
2 changed files with 9 additions and 9 deletions

View File

@@ -2329,13 +2329,13 @@ func TestAccountAsNavigableMap(t *testing.T) {
func TestAccountClone(t *testing.T) {
//empty check
// account := &Account{}
// eOut := &Account{}
// if rcv := account.Clone(); reflect.DeepEqual(eOut, rcv) {
// t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(eOut), utils.ToJSON(rcv))
// }
account := &Account{}
eOut := &Account{}
if rcv := account.Clone(); !reflect.DeepEqual(eOut, rcv) {
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(eOut), utils.ToJSON(rcv))
}
//normal check
account := &Account{
account = &Account{
ID: "testID",
BalanceMap: map[string]Balances{
utils.MONETARY: {&Balance{Value: 10, Weight: 10}}},
@@ -2351,7 +2351,7 @@ func TestAccountClone(t *testing.T) {
Disabled: true,
executingTriggers: true,
}
eOut := &Account{
eOut = &Account{
ID: "testID",
BalanceMap: map[string]Balances{
utils.MONETARY: {&Balance{Value: 10, Weight: 10}}},
@@ -2368,7 +2368,7 @@ func TestAccountClone(t *testing.T) {
executingTriggers: true,
}
if rcv := account.Clone(); reflect.DeepEqual(eOut, rcv) {
if rcv := account.Clone(); !reflect.DeepEqual(eOut, rcv) {
t.Errorf("Expecting: %+v, received: %+v", utils.ToJSON(eOut), utils.ToJSON(rcv))
}

View File

@@ -782,7 +782,7 @@ func TestLoadSharedGroups(t *testing.T) {
},
}
if !reflect.DeepEqual(sg1, expected) {
t.Error("Error loading shared group: ", sg1.AccountParameters["SG1"])
t.Errorf("Expected: %s, received %s ", utils.ToJSON(expected), utils.ToJSON(sg1))
}
sg2 := csvr.sharedGroups["SG2"]
expected = &SharedGroup{