Giter VIP home page Giter VIP logo

Comments (7)

bchavez avatar bchavez commented on May 18, 2024

Hi @JvanderStad , right-o and on point, I think your assumption is correct. Seed is only predictable on the random values pulled from Seed.Next. So, if the number of calls to Next changes it can disrupt the unit tests expected output.

from bogus.

JvanderStad avatar JvanderStad commented on May 18, 2024

thanks 👍

I'll fix the tests, pr coming soon..

from bogus.

bchavez avatar bchavez commented on May 18, 2024

You bring up a good point tough... If you checkout Person.cs, a person is being Initialized (and values pulled including address) when a Faker is constructed. The more correct way is to probably lazily delay person initialization this until a person is actually needed. I think this is what's goofing up the unit tests for you :(

from bogus.

JvanderStad avatar JvanderStad commented on May 18, 2024

I've created 2 new methods: GetRandomValue() and ParseTokens the ParseTokens is recursive. So the amount of calls to Seed.Next is changed by my commit.

Also, I made another branch with lazy loading the Person.. JvanderStad@6695892

from bogus.

JvanderStad avatar JvanderStad commented on May 18, 2024

pr #15 and pr #16

from bogus.

bchavez avatar bchavez commented on May 18, 2024

SUPER cool! Thanks so much. I'll get a release out today for you.

from bogus.

bchavez avatar bchavez commented on May 18, 2024

@JvanderStad You changes are live in v5.0.1 and v5.0.1-beta-2. Thanks again for your contribution! Should appear soon when nuget index catches up.

https://www.nuget.org/packages/Bogus/

Brian

from bogus.

Related Issues (20)

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.