File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,20 @@ public T Create()
58
58
return objectToFill ;
59
59
}
60
60
61
+ /// <summary>
62
+ /// Creates multiple filled objects. Call this after you finished your setup with the FluentAPI and if you want
63
+ /// to create several new objects. If you want to use a existing instance use the <see cref="Fill(T)"/> method.
64
+ /// </summary>
65
+ public IEnumerable < T > Create ( int count )
66
+ {
67
+ for ( int n = 0 ; n < count ; n ++ )
68
+ {
69
+ T objectToFill = ( T ) CreateInstanceOfType ( typeof ( T ) , SetupManager . GetFor < T > ( ) ) ;
70
+ Fill ( objectToFill ) ;
71
+ yield return objectToFill ;
72
+ }
73
+ }
74
+
61
75
/// <summary>
62
76
/// This will fill your instance of an object of type <see cref="T"/> and overrides the setup for the generation.
63
77
/// Use this method if you don't wan't to use the FluentAPI
You can’t perform that action at this time.
0 commit comments