Fixed typo in cover tests and in engine/model_helpers.go

This commit is contained in:
andronache
2021-10-11 12:13:34 +03:00
committed by Dan Christian Bogos
parent 13a27308cb
commit d97b02c7f2
3 changed files with 5 additions and 5 deletions

View File

@@ -2260,7 +2260,7 @@ func (apm AccountMdls) AsTPAccount() (result []*utils.TPAccount, err error) {
costIncrements := make([]*utils.TPBalanceCostIncrement, 0)
sls := strings.Split(tp.BalanceCostIncrements, utils.InfieldSep)
if len(sls)%4 != 0 {
return nil, fmt.Errorf("invlid key: <%s> for BalanceCostIncrements", tp.BalanceCostIncrements)
return nil, fmt.Errorf("invalid key: <%s> for BalanceCostIncrements", tp.BalanceCostIncrements)
}
for j := 0; j < len(sls); j = j + 4 {
costIncrement, err := utils.NewTPBalanceCostIncrement(sls[j], sls[j+1], sls[j+2], sls[j+3])
@@ -2285,7 +2285,7 @@ func (apm AccountMdls) AsTPAccount() (result []*utils.TPAccount, err error) {
unitFactors := make([]*utils.TPBalanceUnitFactor, 0)
sls := strings.Split(tp.BalanceUnitFactors, utils.InfieldSep)
if len(sls)%2 != 0 {
return nil, fmt.Errorf("invlid key: <%s> for BalanceUnitFactors", tp.BalanceUnitFactors)
return nil, fmt.Errorf("invalid key: <%s> for BalanceUnitFactors", tp.BalanceUnitFactors)
}
for j := 0; j < len(sls); j = j + 2 {

View File

@@ -4656,7 +4656,7 @@ func TestAccountMdlsAsTPAccountError(t *testing.T) {
BalanceCostIncrements: "AN;INVALID;COST;INCREMENT;VALUE",
},
}
expectedErr := "invlid key: <AN;INVALID;COST;INCREMENT;VALUE> for BalanceCostIncrements"
expectedErr := "invalid key: <AN;INVALID;COST;INCREMENT;VALUE> for BalanceCostIncrements"
if _, err := testStruct.AsTPAccount(); err == nil || err.Error() != expectedErr {
t.Errorf("Expected %+v, received %+v", expectedErr, err)
}
@@ -4669,7 +4669,7 @@ func TestAccountMdlsAsTPAccountError(t *testing.T) {
testStruct[0].BalanceCostIncrements = utils.EmptyString
testStruct[0].BalanceUnitFactors = "NOT;A;VALUE"
expectedErr = "invlid key: <NOT;A;VALUE> for BalanceUnitFactors"
expectedErr = "invalid key: <NOT;A;VALUE> for BalanceUnitFactors"
if _, err := testStruct.AsTPAccount(); err == nil || err.Error() != expectedErr {
t.Errorf("Expected %+v, received %+v", expectedErr, err)
}

View File

@@ -3203,7 +3203,7 @@ cgrates.org,1001,MonetaryBalance,fltr1&fltr2;100;fltr3
},
},
}
expectedErr := "invlid key: <fltr1&fltr2;100;fltr3> for BalanceUnitFactors"
expectedErr := "invalid key: <fltr1&fltr2;100;fltr3> for BalanceUnitFactors"
if err := ldr.processContent(context.Background(), utils.MetaAccounts, utils.EmptyString); err == nil || err.Error() != expectedErr {
t.Errorf("Expected %+v, received %+v", expectedErr, err)
}