Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个接口 IPerson,它有 2 个读取属性 age (int) 和 name (string)。
我还有一个实现 IPerson 的类 Person。
如何编写 FsCheck 生成器来生成 IPerson 类型的实例?
像下面这样的东西应该可以工作:
Gen<IPerson> gen = from age in Arb.Default.Int32().Generator from name in Arb.Default.String().Generator select new Person(age, name) as IPerson;