Ejemplo n.º 1
0
        public void Setup()
        {
            var context = new GeneratorContext();

            var path = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName;

            context.AddNewGenerator(new IntGenerator());
            context.AddNewGenerator(new StringGenerator());
            context.AddNewGenerator(new ListGenerator());
            context.AddNewGenerator(new DateTimeGenerator());

            _logger.Info("Start loading dll");

            try
            {
                context.LoadNewGenerator(@$ "{path}\DoubleGeneratorLib\bin\Debug\netcoreapp3.1\DoubleGeneratorLib.dll");
                context.LoadNewGenerator(@$ "{path}\FloatGeneratorLib\bin\Debug\netcoreapp3.1\FloatGeneratoLib.dll");
            }
            catch (Exception exception)
            {
                _logger.Debug(exception, "Failed to load dll");
            }

            _faker = new Faker(context);
        }