Skip to content

Fix Grand.Web.Admin.Tests build: update LoginControllerTwoFactorTests to current LoginController constructor - #1017

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

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

Conversation

Copilot AI commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

The CI "build" job failed with CS0246: IGrandAuthenticationService could not be found in LoginControllerTwoFactorTests.cs. The test had drifted from the current LoginController API. Fixing the missing import exposed two further constructor-signature mismatches and a runtime failure in one test.

  • Imports
    • Added Grand.Web.Common.Security.Authentication, which is where IGrandAuthenticationService lives.
    • Added Grand.Web.Common.Localization for IRequestTranslationService.
  • Constructor mocks
    • ITranslationService is now IRequestTranslationService.
    • IMessageProviderService is now ICustomerMessageProviderService.
    • These match the LoginController constructor and the sibling LoginControllerExternalSignInTests.
  • Context accessor
    • SecondStep_ValidCode_SignsInToThePanel threw a NullReferenceException in BaseLoginController.SignInAction.
    • That method reads WorkContext.CurrentCustomer, StoreContext.CurrentStore and WorkingLanguage from the accessor.
    • The IContextAccessor mock is now created with DefaultValue = DefaultValue.Mock, as the sibling test does.
new Mock<IContextAccessor> { DefaultValue = DefaultValue.Mock }.Object

Only the test file changed; 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 constructor Nov 2, 2026
Copilot AI requested a review from KrzysztofPajak November 2, 2026 20:17
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