From 1db6f91ad55e2ab341ec6d140fb64bc699ed0687 Mon Sep 17 00:00:00 2001 From: adragusin Date: Wed, 20 Nov 2019 09:42:13 +0200 Subject: [PATCH] Updated tests in account --- engine/account_test.go | 16 ++++++++-------- engine/loader_csv_test.go | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/account_test.go b/engine/account_test.go index 18ee3f000..d9585bc59 100644 --- a/engine/account_test.go +++ b/engine/account_test.go @@ -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)) } diff --git a/engine/loader_csv_test.go b/engine/loader_csv_test.go index c0f8b971c..ba2444545 100644 --- a/engine/loader_csv_test.go +++ b/engine/loader_csv_test.go @@ -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{