diff --git a/src/FakerDotNet/Fakers/FakeFaker.cs b/src/FakerDotNet/Fakers/FakeFaker.cs index f38d3f3..03dc3f9 100644 --- a/src/FakerDotNet/Fakers/FakeFaker.cs +++ b/src/FakerDotNet/Fakers/FakeFaker.cs @@ -56,7 +56,7 @@ private static IEnumerable GetPlaceholders(string input) .Where(x => x.Success) .Select(x => x.Value); } - + private static FakerMatch GetFakerMatch(string calleeFaker, string placeholder, string input) { var pattern = Regex.Escape(placeholder); @@ -91,11 +91,11 @@ private string Parse(string input, FakerMatch match) return input; } } - + private PropertyInfo GetFaker(string name) { const BindingFlags flags = BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance; - + return _fakerContainer.GetType().GetProperty(name, flags) ?? throw new FormatException($"Invalid module: {name}"); } @@ -105,7 +105,7 @@ private string GetValue(PropertyInfo propertyInfo, string methodName) const BindingFlags flags = BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance; var method = propertyInfo.PropertyType.GetMethod(methodName, flags) ?? throw new FormatException($"Invalid method: {propertyInfo.Name}.{methodName}"); - + var parameters = method.GetParameters().Select(DefaultValue).ToArray(); var value = method.Invoke(propertyInfo.GetValue(_fakerContainer, null), parameters); @@ -123,7 +123,7 @@ private string Numerify(string input) { return Regex.Replace(input, "#", m => _fakerContainer.Number.NonZeroDigit()); } - + private struct FakerMatch { public bool Success;