Process · Testing

Kiến trúc test tích hợp cho Web API

Kiến trúc test tích hợp cho Web API Test xUnit gọi WebApplicationFactory (chạy Program.cs thật) bằng HttpClient. Factory chạy migration thật lên PostgreSQL trong Testcontainers và áp ConfigureTestServices để đè FakeEmailService và TestAuthHandler sau Program.cs. Respawn reset cơ sở dữ liệu trước mỗi test. ConfigureTestServices đè sau Program.cs HTTPCLIENT MIGRATION THẬT RESET TRƯỚC MỖI TEST Test xUnit WebApplicationFactoryProgram.cs thật FakeEmailService TestAuthHandler PostgreSQLTestcontainers Respawn CHÚ GIẢIChạy Program.cs thậtCơ sở dữ liệu thậtDịch vụ bị thay thếHướng gọi © tiennhm