diff --git a/src/Atc.Test/Customizations/Generators/DateOnlyGenerator.cs b/src/Atc.Test/Customizations/Generators/DateOnlyGenerator.cs new file mode 100644 index 0000000..5e42365 --- /dev/null +++ b/src/Atc.Test/Customizations/Generators/DateOnlyGenerator.cs @@ -0,0 +1,22 @@ +#if NET6_0_OR_GREATER +namespace Atc.Test.Customizations.Generators; + +/// +/// Responsible for generating instances +/// that has not been canceled. +/// +[AutoRegister] +public class DateOnlyGenerator : ISpecimenBuilder +{ + /// + public object Create(object request, ISpecimenContext context) + { + if (!request.IsRequestFor()) + { + return new NoSpecimen(); + } + + return DateOnly.FromDateTime(context.Create()); + } +} +#endif \ No newline at end of file