Contributions to AutoContributions
This commit is contained in:
@@ -80,28 +80,28 @@ func TestGetContributions(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetMonthlyContributionRate(t *testing.T) {
|
||||
func TestGetMonthlyAutoContributionRate(t *testing.T) {
|
||||
input := []ledger.Balance{
|
||||
ledger.Balance{"x": 2},
|
||||
ledger.Balance{"x": 4},
|
||||
ledger.Balance{"y": 3},
|
||||
}
|
||||
got := getMonthlyContributionRate(input, time.Hour*24*365/4)
|
||||
got := getMonthlyAutoContributionRate(input, time.Hour*24*365/4)
|
||||
if len(got) != 2 {
|
||||
t.Error(got)
|
||||
}
|
||||
if got["x"] != 2 {
|
||||
if got["x"] != 4 {
|
||||
t.Error(got["x"])
|
||||
}
|
||||
if got["y"] != 1 {
|
||||
if got["y"] != 3 {
|
||||
t.Error(got["y"])
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewContributionPredictor(t *testing.T) {
|
||||
func TestNewAutoContributionPredictor(t *testing.T) {
|
||||
name := "x"
|
||||
currency := ledger.USD
|
||||
predictor := newContributionPredictor(map[string]ledger.Balance{
|
||||
predictor := newAutoContributionPredictor(map[string]ledger.Balance{
|
||||
name: {currency: 10},
|
||||
"y": {"XYZ": 3},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user