Simple helper class to generate a mock person object. The object will be created from two List
's that are given as argument.
var mockPerson = new MockPerson(List<string>, List<string>);
or
var mockPerson = new MockPerson(List<string>, List<string>, DateTime);
The method overload supports up to three arguments in the constructor:
Argument | Function | Type | Required |
---|---|---|---|
Firstname | List to get random name | List | Yes |
Lastname | List to get random name | List | Yes |
Birthday | Startdate to get random date between this date and today | DateTime | No |
Name | Description |
---|---|
Firstname | string of Firstname |
Lastname | string of Lastname |
Birthday | DateTime of birthday |
List<string> firstnameList = new List<string>(){ "Mary", "Bob", "Joe", "Barbara", "Tom", "Linda" };
List<string> lastnameList = new List<string>(){ "Smith", "Johnson", "Williams", "Brown", "Jones", "Miller", "Davis" };
MockPerson mockPerson = new MockPerson(firstnameList, lastnameList);
Console.WriteLine($"New Person: {mockPerson.FirstName} {mockPerson.LastName} born {mockPerson.Birthday}");
If the method is used without a birthday argument the logic will take a date between 1.1.1970
and DateTime.Today
.