Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new string generators #10

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions DapperAutoData/Generators/StringGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ public class StringGenerator<T> : IDataGenerator
public void RegisterGenerators(IFixture fixture) => fixture.Register(() => new StringGenerator<T>(_generator));
}

public class StringHashMD5() : StringGenerator<StringHashMD5>(faker => faker.Random.Hash(32));
public class StringHashSHA1() : StringGenerator<StringHashSHA1>(faker => faker.Random.Hash(40));
public class StringHashSHA224() : StringGenerator<StringHashSHA224>(faker => faker.Random.Hash(56));
public class StringHashSHA256() : StringGenerator<StringHashSHA256>(faker => faker.Random.Hash(64));
public class StringHashSHA384() : StringGenerator<StringHashSHA384>(faker => faker.Random.Hash(96));
public class StringHashSHA512() : StringGenerator<StringHashSHA512>(faker => faker.Random.Hash(128));
public class StringRandom() : StringGenerator<StringRandom>(faker => faker.Random.AlphaNumeric(faker.Random.Number(5,128)));
public class StringParagraph() : StringGenerator<StringParagraph>(faker => faker.Lorem.Paragraph());
public class StringPersonFullName() : StringGenerator<StringPersonFullName>(faker => faker.Name.FullName());
public class StringPhoneNumber() : StringGenerator<StringPhoneNumber>(faker => faker.Phone.PhoneNumber());
Expand Down