Example #1
0
 /// <summary>
 /// Returns a random number of created data objects.
 /// All setable properties and fields will be populated with fake data.
 /// </summary>
 /// <typeparam name="T">The type to create data.</typeparam>
 /// <param name="minCount">The minimum number of items to return.</param>
 /// <param name="maxCount">The maximum number of items to return.</param>
 /// <param name="actions">Optional list of actions that should be executed against each created object instance.</param>
 /// <returns>An enumerable of the requested type.</returns>
 public IEnumerable <T> Fake <T>(int minCount, int maxCount, params Action <T>[] actions) where T : class
 {
     return(Create.Fake(minCount, maxCount, GetRememberedActions <T>().Concat(actions).ToArray()));
 }
Example #2
0
 /// <summary>
 /// Returns one new instance of the requested type.
 /// All setable properties and fields will be populated with fake data.
 /// </summary>
 /// <typeparam name="T">The type to return.</typeparam>
 /// <param name="actions">Optional list of actions that should be executed against each created object instance.</param>
 /// <returns>One new instance on the requested type.</returns>
 public T Fake <T>(params Action <T>[] actions) where T : class
 {
     return(Create.Fake(GetRememberedActions <T>().Concat(actions).ToArray()));
 }