小编use*_*935的帖子

如何使用autofixture构建嵌套属性

如何使用autofixture设置嵌套属性(它是readonly)?像这样的东西:

var result =
    fixture.Build<X>()
    .With(x => x.First.Second.Third, "value")
    .Create();
Run Code Online (Sandbox Code Playgroud)

c# autofixture

5
推荐指数
1
解决办法
1948
查看次数

如何强制 AutoFixture 创建 ImmutableList

在 System.Collections.Generic 中有一个非常有用的 ImmutableList。但是对于这种类型的 Autofixture 会抛出异常,因为它没有公共构造函数,它的创建方式类似于new List<string>().ToImmutableList(). 如何告诉 AutoFixture 填充它?

c# autofixture

5
推荐指数
1
解决办法
286
查看次数

标签 统计

autofixture ×2

c# ×2