#region ========================================================================= USING ===================================================================================== using AutoFixture.Kernel; using System; using System.Diagnostics.CodeAnalysis; #endregion namespace Lumina.Application.UnitTests.Common.Setup; /// /// Represents a specimen builder for the type. /// [ExcludeFromCodeCoverage] public class NullableDateOnlySpecimenBuilder : ISpecimenBuilder { #region ===================================================================== METHODS =================================================================================== /// /// Adds support to the AutoFixture library. /// /// The request to process. /// The context within which the specimen is created. /// A specimen based on the request. public object Create(object request, ISpecimenContext context) { if (request is Type type && type == typeof(DateOnly?)) return (DateOnly?)DateOnly.FromDateTime(DateTime.Now); return new NoSpecimen(); } #endregion }