0

I want AutoFixture to create a list of an object by using an example object.

public class Person
{
    public string Name { get; set; }
    public int Age { get; set; }
}

var examplePerson = new Person { Name = "Test", Age = 34 };
var persons = fixture.CreateMany<Person>();

Conventions I would like to have:

  • create string with max. length of the provided string length (4 in this example)
  • create integers where the max. amount of the computed digits equals the provided digits
  • with a decimal of 14.99 create similar decimals like 93.12
  • and so on

So I want AutoFixture to learn from my given example object.

Is this possible :)?

Rookian
  • 19,841
  • 28
  • 110
  • 180
  • 1
    What you describe might be possible but it will probably result to a unit test which is difficult to write. Please, consider the [3rd paragraph from here](http://stackoverflow.com/a/22708291/467754) first. – Nikos Baxevanis May 21 '14 at 17:33

1 Answers1

2

Is this possible :)?

No, AutoFixture has no built-in AI.

Mark Seemann
  • 225,310
  • 48
  • 427
  • 736