Skip to content

Fix Grand.Web.Admin.Tests build: update LoginControllerTwoFactorTests to current LoginController API - #1016

Draft
KrzysztofPajak with Copilot wants to merge 2 commits into
developfrom
copilot/fix-failing-github-actions-job
Draft

KrzysztofPajak with Copilot wants to merge 2 commits into
developfrom
copilot/fix-failing-github-actions-job

Conversation

Copilot AI commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The CI "build" job failed with CS0246 because LoginControllerTwoFactorTests could not resolve IGrandAuthenticationService. Fixing that exposed two more breaks from drift against the current LoginController constructor, plus a runtime NullReferenceException in one test.

Changes, all in src/Tests/Grand.Web.Admin.Tests/Controllers/LoginControllerTwoFactorTests.cs:

  • Missing usings
    • Added Grand.Web.Common.Security.Authentication for IGrandAuthenticationService.
    • Added Grand.Web.Common.Localization for IRequestTranslationService.
  • Constructor mocks
    • ITranslationService is now IRequestTranslationService.
    • IMessageProviderService is now ICustomerMessageProviderService.
    • These match the LoginController signature.
  • IContextAccessor mock
    • It now uses DefaultValue = DefaultValue.Mock, as LoginControllerExternalSignInTests does.
    • Without it, SecondStep_ValidCode_SignsInToThePanel threw a NullReferenceException in BaseLoginController.SignInAction.

Test-only change; no production code is touched.

Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job build Fix Grand.Web.Admin.Tests build: update LoginControllerTwoFactorTests to current LoginController API Nov 2, 2026
Copilot AI requested a review from KrzysztofPajak November 2, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants