From c5a9849b6bedc60a626becfbf102707bf672d9df Mon Sep 17 00:00:00 2001 From: Christopher Stolworthy Date: Fri, 13 Sep 2024 19:08:29 -0400 Subject: [PATCH] Added generator for random string Added generator for varying hash types --- DapperAutoData/Generators/StringGenerator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DapperAutoData/Generators/StringGenerator.cs b/DapperAutoData/Generators/StringGenerator.cs index ee5b6ca..1db6459 100644 --- a/DapperAutoData/Generators/StringGenerator.cs +++ b/DapperAutoData/Generators/StringGenerator.cs @@ -21,6 +21,13 @@ public class StringGenerator : IDataGenerator public void RegisterGenerators(IFixture fixture) => fixture.Register(() => new StringGenerator(_generator)); } +public class StringHashMD5() : StringGenerator(faker => faker.Random.Hash(32)); +public class StringHashSHA1() : StringGenerator(faker => faker.Random.Hash(40)); +public class StringHashSHA224() : StringGenerator(faker => faker.Random.Hash(56)); +public class StringHashSHA256() : StringGenerator(faker => faker.Random.Hash(64)); +public class StringHashSHA384() : StringGenerator(faker => faker.Random.Hash(96)); +public class StringHashSHA512() : StringGenerator(faker => faker.Random.Hash(128)); +public class StringRandom() : StringGenerator(faker => faker.Random.AlphaNumeric(faker.Random.Number(5,128))); public class StringParagraph() : StringGenerator(faker => faker.Lorem.Paragraph()); public class StringPersonFullName() : StringGenerator(faker => faker.Name.FullName()); public class StringPhoneNumber() : StringGenerator(faker => faker.Phone.PhoneNumber());