Added some tests

This commit is contained in:
adragusin
2020-03-27 17:55:56 +02:00
committed by Dan Christian Bogos
parent 4a5c0f9819
commit 7cdc7efcde
2 changed files with 194 additions and 0 deletions

View File

@@ -76,3 +76,17 @@ func TestValueFormulaParseBalanceFilterValue(t *testing.T) {
t.Errorf("Expecting: %+v, received: %+v", eVF, vf)
}
}
func TestValueFormulaString(t *testing.T) {
vf := &ValueFormula{}
eOut := `{"Method":"","Params":null,"Static":0}`
if rcv := vf.String(); !reflect.DeepEqual(eOut, rcv) {
t.Errorf("Expecting: %+v, received: %+v", eOut, rcv)
}
vf = &ValueFormula{Static: 10000000000.0}
eOut = `{"Method":"","Params":null,"Static":10000000000}`
if rcv := vf.String(); !reflect.DeepEqual(eOut, rcv) {
t.Errorf("Expecting: %+v, received: %+v", eOut, rcv)
}
}