Skip to content

Commit

Permalink
fix: Fix sonar cloud errors
Browse files Browse the repository at this point in the history
  • Loading branch information
katie-gardner committed Dec 9, 2024
1 parent 8b0e2bb commit 7c5c95f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/Dfe.PlanTech.Web/Controllers/PagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ namespace Dfe.PlanTech.Web.Controllers;
[Route("/")]
public class PagesController(
ILogger<PagesController> logger,
IGetPageQuery getPageQuery,
IGetNavigationQuery getNavigationQuery,
IOptions<ContactOptions> contactOptions,
IOptions<ErrorPages> errorPages) : BaseController<PagesController>(logger)
{
private readonly ContactOptions _contactOptions = contactOptions.Value;
private readonly ErrorPages _errorPages = errorPages.Value;
public const string ControllerName = "Pages";
public const string GetPageByRouteAction = nameof(GetByRoute);
public const string NotFoundPage = "NotFoundError";
Expand Down Expand Up @@ -66,7 +64,7 @@ public async Task<IActionResult> NotFoundError()
return View(viewModel);
}

private async Task<INavigationLink> GetContactLinkAsync()
private async Task<INavigationLink?> GetContactLinkAsync()
{
return await getNavigationQuery.GetLinkById(_contactOptions.LinkId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class PagesControllerTests
readonly ICookieService cookiesSubstitute = Substitute.For<ICookieService>();
readonly IUser userSubstitute = Substitute.For<IUser>();
private readonly IGetNavigationQuery _getNavigationQuery = Substitute.For<IGetNavigationQuery>();
private readonly IGetPageQuery _getPageQuery = Substitute.For<IGetPageQuery>();
private readonly PagesController _controller;
private readonly ControllerContext _controllerContext;
private readonly IOptions<ContactOptions> _contactOptions;
Expand All @@ -48,7 +47,7 @@ public PagesControllerTests()
_contactOptions = Options.Create(contactUs);
_errorPages = Options.Create(new ErrorPages { InternalErrorPageId = INTERNAL_ERROR_ID });

_controller = new PagesController(Logger, _getPageQuery, _getNavigationQuery, _contactOptions, _errorPages)
_controller = new PagesController(Logger, _getNavigationQuery, _contactOptions, _errorPages)
{
ControllerContext = _controllerContext,
TempData = Substitute.For<ITempDataDictionary>()
Expand Down

0 comments on commit 7c5c95f

Please sign in to comment.