We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42cbcc2 commit 8b40171Copy full SHA for 8b40171
src/Atc.Test/Customizations/Generators/DateOnlyGenerator.cs
@@ -0,0 +1,22 @@
1
+#if NET6_0_OR_GREATER
2
+namespace Atc.Test.Customizations.Generators;
3
+
4
+/// <summary>
5
+/// Responsible for generating <see cref="DateOnly"/> instances
6
+/// that has not been canceled.
7
+/// </summary>
8
+[AutoRegister]
9
+public class DateOnlyGenerator : ISpecimenBuilder
10
+{
11
+ /// <inheritdoc/>
12
+ public object Create(object request, ISpecimenContext context)
13
+ {
14
+ if (!request.IsRequestFor<DateOnly>())
15
16
+ return new NoSpecimen();
17
+ }
18
19
+ return DateOnly.FromDateTime(context.Create<DateTime>());
20
21
+}
22
+#endif
0 commit comments