-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Override nullability strategy #89
Comments
Any update about the issue? |
Hi sorry @mahdibohloul I missed seeing your issue previously. The issue comes as you have both null types and default values. So while the null strategy will ensure it won't generate a null at random, the optional strategy will randomly choose between generating a value or using the default value. What this means is for this scenario you also need to override the optionalStrategy to be NeverOptionalStrategy:
|
Hi there,
According to your document about overriding nullability strategy, I have an issue with it in nullable properties.
I have a data class like:
And I'm using KotlinFixture to write tests like that:
I expected the
id
attribute to always have a value. But this is not the case and sometimes it is null and the test is not deterministic and sometimes it is passed and sometimes it is not.My fixture version:
1.2.0
The text was updated successfully, but these errors were encountered: