【发布时间】:2021-06-13 11:37:12
【问题描述】:
我正在为 Bogus 生成的字符串属性编写规则:
var fakeThings= new Faker<Thing>()
.RuleFor(x => x.Name, f => f.Company.CompanyName());
如何在指定值之间生成Bogus中的字符串属性?比如:
.RuleFor(x => x.Name, f => f.Company.CompanyName().Length(1, 30);
// returns CompanyName with min 1 char and max 30 chars
【问题讨论】: