我的構建器設置爲處理參數或屬性。這可能會改變未來,但現在這是我在我的建設者: public class UserNameBuilder : ISpecimenBuilder
{
public object Create(object request, ISpecimenContext context)
{
var propertyInfo = request as
想象一下,一個簡單的映射場景: public class Person {
public string Firstname { get; set; }
public string Surname { get; set; }
}
public class PersonDTO {
public string Firstname { get; set; }
鑑於兩類: class Foo
{
...
}
class Bar
{
public Foo FooBar { get; set; }
}
我已經設置了以下測試: void Test()
{
var fixture = new Fixture();
fixture.Customize<Foo>(x => x.FromSeed(TestFo