如何使用autofixture设置嵌套属性(它是readonly)?像这样的东西:
var result =
fixture.Build<X>()
.With(x => x.First.Second.Third, "value")
.Create();
Run Code Online (Sandbox Code Playgroud) 在 System.Collections.Generic 中有一个非常有用的 ImmutableList。但是对于这种类型的 Autofixture 会抛出异常,因为它没有公共构造函数,它的创建方式类似于new List<string>().ToImmutableList(). 如何告诉 AutoFixture 填充它?