first commit
This commit is contained in:
19
Nitrox.Test/Helper/Faker/NitroxActionFaker.cs
Normal file
19
Nitrox.Test/Helper/Faker/NitroxActionFaker.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Nitrox.Test.Helper.Faker;
|
||||
|
||||
public class NitroxActionFaker : NitroxFaker, INitroxFaker
|
||||
{
|
||||
private readonly Func<Bogus.Faker, object> generateAction;
|
||||
|
||||
public NitroxActionFaker(Type type, Func<Bogus.Faker, object> action)
|
||||
{
|
||||
OutputType = type;
|
||||
generateAction = action;
|
||||
}
|
||||
|
||||
public INitroxFaker[] GetSubFakers() => Array.Empty<INitroxFaker>();
|
||||
|
||||
public object GenerateUnsafe(HashSet<Type> _) => generateAction.Invoke(Faker);
|
||||
}
|
Reference in New Issue
Block a user