#region ========================================================================= USING ===================================================================================== using AutoFixture.Kernel; using System; using System.Diagnostics.CodeAnalysis; #endregion namespace Lumina.DataAccess.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) { return request is Type type && type == typeof(DateOnly?) ? (DateOnly?)DateOnly.FromDateTime(DateTime.Now) : (object)new NoSpecimen(); } #endregion }