#region ========================================================================= USING ===================================================================================== using Bogus; using Lumina.Presentation.Web.Common.DTO.Themes; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; #endregion namespace Lumina.Presentation.Web.Fixtures.Common.DTO.Themes; /// /// Fixture class for generating test data. /// [ExcludeFromCodeCoverage] public class ThemeRenderDocumentDtoFixture { private readonly Faker _faker = new(); private readonly ThemeInfoDtoFixture _themeInfoDtoFixture = new(); /// /// Creates a new instance with randomized test data. /// /// Optional metadata of the resolved theme. /// Optional raw template source to render. /// A configured instance. public ThemeRenderDocumentDto Create( ThemeInfoDto? theme = null, string? template = null) { return new ThemeRenderDocumentDto( Theme: theme ?? _themeInfoDtoFixture.Create(), Template: template ?? _faker.Lorem.Paragraph() ); } /// /// Creates multiple instances with randomized test data. /// /// Number of instances to create. /// List of configured instances. public List CreateMany(int count = 3) { return [.. Enumerable.Range(0, count).Select(_ => Create())]; } }