First -- There's a typo in your post title, please fix that so others can find this post.
Second -- This behavior is clearly documented in AutoBogus' Readme, under Binders.
A default IAutoBinder implementation is included with AutoBogus, but it will not generate interfaces or abstract classes. For this, the following packages are available ...
So you're going to want to add one of those NuGet packages to your project and use it to configure your auto generator.
Example, using NSubstitute (my personal favorite C# mocking library):
var user = AutoFaker.Generate<User>(builder =>
builder.WithBinder(new NSubstituteBinder()));
This injects the User constructor with what essentially amounts to Substitute.For<IValidate>().
First -- There's a typo in your post title, please fix that so others can find this post.
Second -- This behavior is clearly documented in AutoBogus' Readme, under Binders.
So you're going to want to add one of those NuGet packages to your project and use it to configure your auto generator.
Example, using NSubstitute (my personal favorite C# mocking library):
This injects the
User
constructor with what essentially amounts toSubstitute.For<IValidate>()
.