Reputation: 190
I'm currently learning using AutoFixture and can't figure out if there is a neat way to let AutoFixture generate a specimen that adheres the rules defined in my validator using FluentValidation.
Let AutoFixture generate speciman following rules defined in validator.
AutoFixture generates random properties that violate the validation rules.
Can AutoFixture create specimens adhering a AbstractValidator from FluentValidation?
Upvotes: 2
Views: 423
Reputation: 1274
Out of the box AutoFixture supports only DataAnnotations attributes as a means to generate models that would pass validation.
To my knowledge there is currently no glue library that would integrate AutoFixture with FluentValidation.
As a solution you might want to create customizations for your models that would adhere to the rules defined in your validators. Then compose the customizations in a way that would make sense for the tested scenario.
Upvotes: 1