#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Authorization;
using Lumina.Presentation.Web.Common.DTO.Themes;
using Lumina.Presentation.Web.Common.Enums.Authorization;
using Lumina.Presentation.Web.Common.Primitives;
using Lumina.Presentation.Web.Common.Routes;
using Lumina.Presentation.Web.Common.Services;
using Lumina.Presentation.Web.Core.Themes;
using Lumina.Presentation.Web.Fixtures.Common.DTO.Themes;
using Lumina.Presentation.Web.Fixtures.Common.TestHelpers;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewEngines;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.Extensions.Localization;
using NSubstitute;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.UnitTests.Core.Themes;
///
/// Contains unit tests for the class.
///
[ExcludeFromCodeCoverage]
public class ThemeLayoutRendererTests
{
private readonly IApiHttpClient _mockApiHttpClient;
private readonly ICompositeViewEngine _mockViewEngine;
private readonly ITempDataProvider _mockTempDataProvider;
private readonly IServiceProvider _mockServiceProvider;
private readonly IHttpContextAccessor _mockHttpContextAccessor;
private readonly IUrlService _mockUrlService;
private readonly IStringLocalizerFactory _mockStringLocalizerFactory;
private readonly IStringLocalizer _mockStringLocalizer;
private readonly IAuthorizationService _mockAuthorizationService;
private readonly IView _mockHeadView;
private readonly IView _mockAudioPlayerView;
private readonly IView _mockScriptsView;
private readonly IView _mockNavMenuView;
private readonly ThemeResponseDtoFixture _themeResponseDtoFixture = new();
private readonly ThemeTemplateResponseDtoFixture _themeTemplateResponseDtoFixture = new();
private readonly ThemeLayoutPageDtoFixture _themeLayoutPageDtoFixture = new();
private readonly ThemeLayoutRenderer _sut;
///
/// Initializes a new instance of the class.
///
public ThemeLayoutRendererTests()
{
_mockApiHttpClient = Substitute.For();
_mockViewEngine = Substitute.For();
_mockTempDataProvider = Substitute.For();
_mockTempDataProvider.LoadTempData(Arg.Any()).Returns(new Dictionary());
_mockServiceProvider = Substitute.For();
_mockServiceProvider.GetService(typeof(IModelMetadataProvider)).Returns(new EmptyModelMetadataProvider());
_mockHttpContextAccessor = Substitute.For();
_mockUrlService = Substitute.For();
_mockUrlService.GetAbsoluteUrl(Arg.Any(), Arg.Any