Integration tests (WebApplicationFactory)
Në shqip: Testet e integrimit në ASP.NET
ShpjegimiSQ
WebApplicationFactory nis gjithë API-n tënde në memorie gjatë testeve, që të dërgosh kërkesa HTTP të vërteta dhe të kontrollosh përgjigjet — pa server të jashtëm.
EnglishEN
WebApplicationFactory starts your whole API in memory during tests, so you send real HTTP requests and check the responses — without an external server.
Si ta mendosh
Si prova gjenerale e një shfaqjeje me të gjithë aktorët.
Lexoje në anglisht
Like a full dress rehearsal with the whole cast.
Shembull kodicsharp
var klienti = factory.CreateClient();
var pergjigja = await klienti.GetAsync("/api/nxenesit");
pergjigja.EnsureSuccessStatusCode();