Extract function

This commit is contained in:
Jan Bader 2022-04-05 20:45:00 +00:00
parent 8df7968175
commit 49d96be1e3

View File

@ -87,6 +87,12 @@ func TestMain(t *testing.T) {
loc := time.Now().Location()
AssertCategoriesAndAvailableEqual(t, loc, handler, ctx, budget)
// check accounts
}
func AssertCategoriesAndAvailableEqual(t *testing.T, loc *time.Location, handler *Handler, ctx context.Context, budget *postgres.Budget) {
resultDir := "../testdata/production-export/results"
files, err := os.ReadDir(resultDir)
if err != nil {
@ -108,10 +114,6 @@ func TestMain(t *testing.T) {
testCaseFile := filepath.Join(resultDir, file.Name())
handler.CheckAvailableBalance(ctx, t, testCaseFile, budget, first)
}
// check categories
// check accounts
}
type TestData struct {