示例#1
0
        public void Setup()
        {
            RegisterGenerators.Register(new IntGen());
            RegisterGenerators.Register(new StrGen());
            RegisterGenerators.Register(new DateGen());
            RegisterGenerators.Register(new ListGen());

            RegisterGenerators.RegisterPlugins();

            faker = new Faker();
        }
示例#2
0
        public static void Main()
        {
            RegisterGenerators.Register(new IntGen());
            RegisterGenerators.Register(new StrGen());
            RegisterGenerators.Register(new ListGen());
            RegisterGenerators.Register(new DateGen());

            RegisterGenerators.RegisterPlugins();


            var faker = new Faker();
            Foo foo   = faker.Create <Foo>();
            Moo moo   = faker.Create <Moo>();

            Console.WriteLine(JsonConvert.SerializeObject(foo));
            Console.WriteLine(JsonConvert.SerializeObject(moo));
        }