Add comprehensive TDD infrastructure with 45 tests

- Add lib crate exposing modules for integration testing
- Add dev-dependencies: tokio-test 0.4, tempfile
- Refactor parse_csv_fields() as pure function for unit testing
- Add field validation (minimum 16 fields required)
- Fix repository last_insert_id using SELECT LAST_INSERT_ID()
- Add 10 lib tests for CSV parsing and date formatting
- Add 10 config tests for environment configuration
- Add 7 import tests for CSV file parsing
- Add 6 models tests for database structs
- Add 12 repository tests for CRUD operations
This commit is contained in:
2026-04-02 11:13:41 +02:00
parent 429d5d774f
commit e2123e4619
11 changed files with 1648 additions and 87 deletions

View File

@@ -3,6 +3,14 @@ name = "invoice-generator"
version = "0.1.0"
edition = "2021"
[lib]
name = "invoice_generator"
path = "src/lib.rs"
[[bin]]
name = "invoice-generator"
path = "src/main.rs"
[dependencies]
askama = "0.15.5"
chrono = { version = "0.4.44", features = ["serde"] }
@@ -13,3 +21,7 @@ tokio = { version = "1", features = ["full"] }
toml = "0.8"
anyhow = "1"
bigdecimal = { version = "0.4", features = ["serde"] }
[dev-dependencies]
tokio-test = "0.4"
tempfile = "3"