Skip to content

Commit 0c2da4f

Browse files
committed
Fixed the existing documentation
1 parent d5a503d commit 0c2da4f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ public class PersonRandomizer : ComplexRandomizer<Person>
9898
{
9999
public PersonRandomizer()
100100
{
101-
this.AddRandomizationRule(p => p.Id, new GuidRandomizer());
102-
this.AddRandomizationRule(p => p.Name, new StringRandomizer());
103-
this.AddRandomizationRule(p => p.Age, new NumberRandomizer());
104-
this.AddRandomizationRule(p => p.IsEmployed, new BooleanRandomizer());
105-
this.AddRandomizationRule(p => p.EventDate, new DateTimeOffsetRandomizer());
101+
this.Randomize(p => p.Id, new GuidRandomizer());
102+
this.Randomize(p => p.Name, new StringRandomizer());
103+
this.Randomize(p => p.Age, new NumberRandomizer());
104+
this.Randomize(p => p.IsEmployed, new BooleanRandomizer());
105+
this.Randomize(p => p.EventDate, new DateTimeOffsetRandomizer());
106106
}
107107
}
108108
```
@@ -161,5 +161,4 @@ The order will be preserved - the value setter of a given randomization rule wil
161161

162162
- We do not recommend using `complex randomizers` with abstract classes or interfaces.
163163
While it is possible to make such a setup work, there may be some intricacies along the way.
164-
The `AddRandomizationRule` and `OverrideRandomizationRule` methods are publicly exposed so extension methods can be extracted (or even inheritance will get the job done for some simple cases).
165164
Another idea that is especially useful when dealing with many derived types that have behavioral but not structural differences, is to make the `complex randomizer` generic.

0 commit comments

Comments
 (0)