Generating Fake Data in C# with Bogus

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 65

  • @d3tn3tracer
    @d3tn3tracer Год назад +10

    Thank you Tim! Our team is learning Unit Tests right now and you have one about Bogus. Thank you for your work for community! 😊

  • @YazanGplay
    @YazanGplay Год назад +1

    This is the second time you upload a problem solving video after I discuss with my colleague about it. Yesterday we were discussing how should we seed the database every time we run a new instance in docker.
    Very useful video, Thanks Tim!

    • @IAmTimCorey
      @IAmTimCorey  Год назад +9

      Just keep talking near my hidden microphone. 😉

  • @troybryantIII
    @troybryantIII Год назад

    Started a new project and this was the testing suit selected. Life saver...

  • @andywalter7426
    @andywalter7426 7 месяцев назад

    Did you know that bogus had a dumpstring method. If you used the DumpString method, it would return the json. Then a normal class for the model would be fine.

  • @khangle6872
    @khangle6872 Год назад

    having worked with many frameworks across languages, I do see the appeal of a heavy battery-included framework. The industry nowadays tend toward micro-framework that start out small and open for plugin or addon to expand functionality, and we add things as we need it. Which make sense in its own right
    But for heavy frameworks, everything is streamlined and function with each other much more coherent.
    Laravel, for example, had almost every layer of a typical application built into its core. The DataGenerator, which they called DatabaseFactory, and the Seeder itself where you define the rule for each model, using the popular FakerPHP that they also maintain; are all configured in the fresh installation of the framework. Which, also heavily documented.
    Also, things like data-aware input validation. Even something that could be as simple as "username must be unique" can be quite a hassle in Python Flask or Java Spring Boot, or even Asp.net, since the data access isnt really a part of the framework. Though it do open for us the freedom to choose our Orm. I really miss
    'username' => [
    'required',
    'unique:users,email_address',
    'max:20',
    'min:10'
    ],

  • @lukaszrutkowski
    @lukaszrutkowski Год назад +1

    Thank you Tim for all your and your team work. I have learned tons from your courses library (each course is a masterpiece on it's own), as well as from YT. Cannot wait for new things :)
    PS. Bogus is a Polish name :))

    • @IAmTimCorey
      @IAmTimCorey  Год назад +1

      Awesome! I’m glad my content has been so helpful.

  • @HollandHiking
    @HollandHiking Год назад +2

    I like it a lot, but for other countries than the US you may need to create extensions, f.i. to generate valid phone numbers, addresses, and ZIP codes. For example, the Dutch ZIP code is structured like this: four digits, a space and the two characters like 2231 ZZ. I have seen you can do that. I will give it a try.

    • @IAmTimCorey
      @IAmTimCorey  Год назад +1

      You can do that. Here is an issue with an example of how to do so: github.com/bchavez/Bogus/issues/242

  • @EluviumMC
    @EluviumMC Год назад

    Great find and demonstration of this library! Thanks for sharing!

  • @steveclarke8720
    @steveclarke8720 Год назад +1

    As always great demos and instruction. Perfectly timed as I am creating large sets of data for a product demo.

  • @claudiocespon4128
    @claudiocespon4128 Год назад

    Thanks Tim! This seems to be an excellent tool to test database performance degradation too!

  • @jakubduch1392
    @jakubduch1392 3 месяца назад

    Great video and finally something what isn't two hours long ;) Thx Mr.Corey

  • @dmytrohryhsyn8382
    @dmytrohryhsyn8382 Год назад

    Thank you Tim. I started to implement random generator by myself. I should probably google for existing solutions at first :)

  • @killpopers
    @killpopers Год назад +1

    Always use this for unit testing it ensures you don't have know values in your test for values that don't need to be fixed forcing the dev to think about the logic not the data.

  • @tresaidh3y90
    @tresaidh3y90 Год назад

    Amazing as always Tim! Thanks so much!

  • @hadrien03
    @hadrien03 Год назад

    Wow, I was just checking fake data libraries for a work project today!

  • @MrMAbukhadra
    @MrMAbukhadra Год назад

    Great tool for testing the application.
    Thank you

  • @jesusdelarua5995
    @jesusdelarua5995 Год назад

    Great video!!!
    Thank you Tim.

  • @KorruFreez
    @KorruFreez Год назад

    Bogus is extremely helpful, thanks for the video!

  • @CodeLlama
    @CodeLlama Год назад

    This is awesome! I can see a lot of use cases!

  • @MarioStaats
    @MarioStaats Год назад

    awesome idea to save it in the DB, to have "real environment" Test Data *ThumbUp

  • @agentsmith8434
    @agentsmith8434 Год назад

    Great video. Do you have a video about Repository Pattern?

  • @M0nedula
    @M0nedula Год назад

    Is there a way to generate data specific for a country? Zip codes have different formats. Maybe use names of people and streets and cities that can occur in a country?

    • @IAmTimCorey
      @IAmTimCorey  Год назад +1

      For zip codes, you can format them for any region using the region pattern: github.com/bchavez/Bogus/issues/242

  • @microtech2448
    @microtech2448 Год назад

    Hi, how is it possible to give sequential Id instead of random?

  • @anassnassim
    @anassnassim 11 месяцев назад

    thank you for this tutorial
    is there any way for exemple with this nuget or anything else if i send him as string "CityName" return This Is A City in bogus
    is these possible ?

    • @IAmTimCorey
      @IAmTimCorey  11 месяцев назад +1

      I'm not sure what you want to do here. Sorry.

    • @anassnassim
      @anassnassim 11 месяцев назад

      ​@@IAmTimCorey First thank you for your replay
      I want to develop an app using C#. The app should receive a string, for example, 'FullName,' and generate fake data that represents a name. I'm uncertain if there's a package available to assist with this or if I'll need to utilize 'bogus' and potentially some conditional statements to achieve the desired result.

    • @IAmTimCorey
      @IAmTimCorey  11 месяцев назад +1

      Bogus plus conditionals is probably your best bet.

    • @anassnassim
      @anassnassim 11 месяцев назад

      @@IAmTimCorey ok thank you so much

  • @harrivayrynen
    @harrivayrynen Год назад

    Any news when monthly pass is available. Would be nice to try it before going to year pass.

    • @IAmTimCorey
      @IAmTimCorey  Год назад +1

      Very soon but I don’t have a date. Email help@iamtimcorey.com and Tom can probably get you in early.

  • @ahmeddabas
    @ahmeddabas Год назад

    as always , great video
    thanx bro

  • @JorijnLamberink
    @JorijnLamberink Год назад

    Decent introduction to Bogus.
    The demonstration could have been more to the point, now we have a 36 minute video without chapters filled with a hole bunch of blazor
    azor content.

    • @IAmTimCorey
      @IAmTimCorey  Год назад +2

      Well, it sounds like you got more than you paid for, so that’s good.

    • @manilladrift
      @manilladrift Год назад

      ​@@IAmTimCorey clever response 😅

  • @marcoguerra6349
    @marcoguerra6349 Год назад

    Interesting, for sure it can be useful

  • @rodrigo6459
    @rodrigo6459 Год назад

    Is there a way to correlate a name with an enum for gender?

  • @h.jpouya4715
    @h.jpouya4715 Год назад

    Awesome