Git Product home page Git Product logo

Comments (7)

soenneker avatar soenneker commented on May 31, 2024 3

@benjaminsampica Fair points. I'm not opposed to a Bogus wrapper. I'll take a look.

from soenneker.utils.autobogus.

conradakunga avatar conradakunga commented on May 31, 2024 3

@soenneker huge thanks for thanking this over and fixing some of the bugs (like DateOnly issues).

Cosign on @benjaminsampica - it would be great to allow customization the way AutoBogus classic did

from soenneker.utils.autobogus.

soenneker avatar soenneker commented on May 31, 2024 1

@benjaminsampica @conradakunga OK I've implemented AutoFaker<T>. I have some tests in place, but if you run into any issues with it please let me know. Thanks

from soenneker.utils.autobogus.

soenneker avatar soenneker commented on May 31, 2024

Can you expand on your example some? Was this supported in AutoBogus before?

I removed a bunch of extension methods from the autofakerconfigbuilder but I think the majority of it exists within the AutoFakerConfig...

I could definitely be wrong.

Happy to help solve any friction!

from soenneker.utils.autobogus.

benjaminsampica avatar benjaminsampica commented on May 31, 2024

Looking to do something like this (from AutoBogus). There was also Ignore(), which would skip a property.

var personFaker = new AutoFaker<Person>()
 .RuleFor(fake => fake.Id, fake => fake.Random.Int())
 .Generate();

If you’re familiar with AutoFixture at all, their convention is With() and Without()

from soenneker.utils.autobogus.

marcio-af-oliveira avatar marcio-af-oliveira commented on May 31, 2024

@soenneker I'm trying to use the new implemented AutoFaker<T> with a static value for a property but it is throwing: Object reference not set to an instance of an object.

My implementation:

var test = new AutoFaker<Entity>()
    .RuleFor(e => e.TypeA, nameof(EnumTypeA.Lorem))
    .RuleFor(e => e.TypeB, nameof(EnumTypeB.Lorem))
    .Generate(3);

from soenneker.utils.autobogus.

soenneker avatar soenneker commented on May 31, 2024

@marcio-af-oliveira can you send me the full exception message with the callstack? I just built several tests just like how you have your code there and have no issues.

from soenneker.utils.autobogus.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.