-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generating a class with a .NET 6 DateOnly
property fails
#76
Comments
Right after I submitted, I realized I should have checked Bogus... seems like they are tracking this here, but once it is implemented It will still need to be added to here in a new package reference? |
@nickdodd79 FYI, Bogus just pushed v34.x which should accommodate this |
Hey @pdevito3 Thanks for the update. I will get some updates in place so the latest Bogus and .NET capabilities are available. Watch this space. Nick. |
Sounds good. No rush, just wanted to flag it in case you hadn't seen. Happy Turkey week! |
hey @nickdodd79, what would the lift be for this? I can look into a PR myself if you're open to it and can give me a ballpark of what i should be looking at |
thanks @pdevito3: we are currently using this lib (thanks @nickdodd79 !) and this would definitely solve our issue. |
@lsimone i ended up publishing a forked version of Autobogus given @nickdodd79's inactivity. It should fix this if you want to give it a whirl to resolve your issue. If you have any problems let me know: https://github.com/pdevito3/AutoBogus Not sure how active I'll be maintaining it and really hoping nick takes things back over, but it's seeming more and more abandoned. |
+1 for this fix, it's quite unfortunate. Thank you @pdevito3 for publishing the modified package. |
As a workaround you can use a CustomInstantiator on your class which sets the value like so:
|
@pdevito3 graciously implemented this in soenneker.utils.autobogus as well! |
I have an entity that looks like this in a .NET 6 project:
When I run this faker:
in a test like this:
I get this error.
I know .NET 6 is new, but I have tons of use cases I'd like to refactor a
DateOnly
prop and this is a definite blocker with how my tests are currently set up :-(The text was updated successfully, but these errors were encountered: