Fixed unit test for ExtRateSIncrement

This commit is contained in:
porosnicuadrian
2021-09-23 18:04:06 +03:00
committed by Dan Christian Bogos
parent 6849529d2e
commit 1c75005643
2 changed files with 12 additions and 10 deletions

View File

@@ -20,7 +20,6 @@ package accounts
import (
"bytes"
"fmt"
"log"
"os"
"reflect"

View File

@@ -1177,16 +1177,17 @@ func TestAccountMaxAbstracts(t *testing.T) {
{
IncrementStart: nil,
IntervalRateIndex: 0,
RateID: "",
CompressFactor: 0,
RateID: "id_for_Test",
CompressFactor: 1,
Usage: nil,
},
},
CompressFactor: 1,
}
for _, val := range rpEv.Rating {
if !reflect.DeepEqual(val, expRating) {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expRating, val)
val.Increments[0].RateID = "id_for_Test"
if !reflect.DeepEqual(expRating, val) {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", utils.ToJSON(expRating), utils.ToJSON(val))
}
}
rpEv.Rating = map[string]*utils.ExtRateSInterval{}
@@ -1381,16 +1382,17 @@ func TestAccountDebitAbstracts(t *testing.T) {
{
IncrementStart: nil,
IntervalRateIndex: 0,
RateID: "",
CompressFactor: 0,
RateID: "id_for_test",
CompressFactor: 1,
Usage: nil,
},
},
CompressFactor: 1,
}
for _, val := range rpEv.Rating {
val.Increments[0].RateID = "id_for_test"
if !reflect.DeepEqual(val, expRating) {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expRating, val)
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", utils.ToJSON(expRating), utils.ToJSON(val))
}
}
rpEv.Rating = map[string]*utils.ExtRateSInterval{}
@@ -1585,14 +1587,15 @@ func TestAccountActionSetBalance(t *testing.T) {
{
IncrementStart: nil,
IntervalRateIndex: 0,
RateID: "",
CompressFactor: 0,
RateID: "id_for_test",
CompressFactor: 1,
Usage: nil,
},
},
CompressFactor: 1,
}
for _, val := range rpEv.Rating {
val.Increments[0].RateID = "id_for_test"
if !reflect.DeepEqual(val, expRating) {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expRating, val)
}