Add comprehensive xUnit test coverage (≥95% line) for ASP.NET Core projects#45
Open
tobydrinkall wants to merge 2 commits into
Open
Add comprehensive xUnit test coverage (≥95% line) for ASP.NET Core projects#45tobydrinkall wants to merge 2 commits into
tobydrinkall wants to merge 2 commits into
Conversation
…jects - 156 xUnit tests across 25 test files covering 5 ASP.NET Core projects - Tests for controllers, models, services, page models, Identity pages, DbContext CRUD - Mocked I/O boundaries: EF Core InMemory, SignInManager, UserManager, IWebHostEnvironment - Extern aliases to manage namespace collisions across projects - Coverlet coverage enforcement: 100% line, 92.85% branch, 100% method - Excluded from coverage: auto-generated Razor views, Program/Startup, EasyQuery-dependent classes Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Implement IDisposable to track and clean up temp directories and DbContext instances created by CreateReportGenerator(). Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 156 xUnit tests across 25 test files in
Tests/EqSamples.Tests/covering all 5 ASP.NET Core projects. Achieves 100% line coverage (92.85% branch, 100% method) on testable code with coverlet threshold enforcement at 95%.Test project setup (
EqSamples.Tests.csproj)MvcDataFiltering::,RazorAdHoc::, etc.) to manage namespace collisions across projects sharingEqDemo.Models.*<Threshold>95</Threshold>with<ThresholdType>line</ThresholdType>enforced in the csprojCoverage by module
What's tested
HomeController,WeatherForecastController,ValuesController,OrderController(constructor + Index)Name,FullName), edge cases (null/empty)IndexModel,PrivacyModel,ErrorModel,AboutModel—OnGet()with mockedILogger,HttpContextLoginModel(OnGetAsync, OnPostAsync with success/lockout/2FA/failed paths),LogoutModel(OnGet, OnPost),RegisterModel(OnGet, OnPostAsync with success/failure/AddToRole paths) — mockedSignInManager,UserManager,IEmailSenderDefaultReportGenerator(file reading, report creation),ReportStore(user-isolated query operations via mockedIHttpContextAccessor/ClaimsPrincipal)InMemoryDatabaseExcluded from coverage (auto-generated / EasyQuery infrastructure)
AspNetCoreGeneratedDocument.*, compiled Razor pages/views,Program,Startup,DbInitializeExtensions,OrderControllerasync methods (EasyQueryEasyQueryManagerLinq),ReportStoreQuery-dependent methods,CustomEasyQueryManagerSqlLink to Devin session: https://app.devin.ai/sessions/03f818b39c2f4cfe9304a9fef59bc215
Requested by: @tobydrinkall
Devin Review