Skip to content
TheCodeKing edited this page Jul 16, 2011 · 6 revisions

Overview | How To | Create An Instance

Creating an instance using the library is easy using the Generic interface. Classes are implicitly cast to the generic type, or can be referenced explicitly using the Object property. Do not use the var keyword without casting the instance, or referencing the created instance explicitly.

Once created all of the public members will be recursively populated with test data. By default strings are set to the name of the containing member, and value types are set to their corresponding MaxValue.

Implicit cast

Person person = Auto.Make<Person>();

Explicit cast

var person = Auto.Make<Person>().Object;

var person = (Person)Auto.Make<Person>();

Clone this wiki locally