mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-25 07:45:44 +00:00
feat: manual pullet cost
This commit is contained in:
@@ -43,6 +43,27 @@ func TestCalculateDepreciationAtDayN_UsesRemainingBasisRecursively(t *testing.T)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCalculateDepreciationFromDayRange_StartsFromProvidedScheduleDay(t *testing.T) {
|
||||
percentByHouseType := map[string]map[int]float64{
|
||||
"close_house": {
|
||||
1: 10,
|
||||
2: 20,
|
||||
3: 5,
|
||||
},
|
||||
}
|
||||
|
||||
pulletCostDayN, depreciationValue, depreciationPercent := CalculateDepreciationFromDayRange(1000, 2, 3, "close_house", percentByHouseType)
|
||||
if pulletCostDayN != 800 {
|
||||
t.Fatalf("expected remaining basis entering day 3 to be 800, got %v", pulletCostDayN)
|
||||
}
|
||||
if depreciationValue != 40 {
|
||||
t.Fatalf("expected day 3 depreciation to be 40, got %v", depreciationValue)
|
||||
}
|
||||
if depreciationPercent != 5 {
|
||||
t.Fatalf("expected day 3 depreciation percent to be 5, got %v", depreciationPercent)
|
||||
}
|
||||
}
|
||||
|
||||
func mustDepreciationDate(t *testing.T, raw string) time.Time {
|
||||
t.Helper()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user