Giter Club home page Giter Club logo

faker.net's Introduction

FFaker.Net

A simple NuGet Package wrapper for Faker.Net that's been forked

This is the project built upon Faker.Net by Jon Wingfield (https://github.com/jonwingfield/Faker.Net)

I forked the NuGet package and then noticed that I couldn't generate a Number easily. What? Oh wait, there it is in FakerRand...puke. And what's with an additional namespace for exension methods. Why?

What's with all those obsolete methods? Man, that sure is confusing, which do I use?

I can't generate some date's either? Doh.

How about simple numbers? Oh yeah there's that FakerRand thing again. What a strange name. I guess I have to...groan I'm lazy...inspect the source. LOL

What I did

I got rid of all the obsolete methods. I removed the extra namespace.

In Lorem: I renamed other methods that didn't make sense, and removed one that was just plain misleading. I got rid varying paragraphs. If you want 3 sentences then you get three sentences. If you want between 3 and 5 sentences, then ask for them. I then introduced some extension methods that made it more english friendly.

Before: Lorem.GetSentences(3) After: 3.Sentences()

or

3.Paragraphs() -> 3 Paragraphs...this crap could write itself. :P

or

2.Words() -> two words output

And something like this:

Lorem.GetBetween(3, 5).Sentences() or Number.Between(3, 5).Sentences() -> same thing or Lorem.GetSentences(3, 5)

Number

Gives a random number between two values, same as random.Next except english friendly again. Number.Between(1, 3)

same with

Number.Below(10)

Date

Same sort of thing here except I put in Past and Future as I noticed that in some cases I just wanted to show dates that were either.

Date.Past(10) -> Generate a date in the past ten days Date.Past(10, DateType.Month) -> Generate a date in the past month

Date.Between(DateTime.Now.AddDay(-1), DateTime.Now.AddDay(12)) -> Generate a date between yesterday and 12 days from now or Date.Between(-1, 12) -> same thing

FYI: I only needed whole date values so this can get better but for now I'm just using Days mostly.

Warning: No written tests, sorry, I didn't want to write any of this but started and then went deeper than I needed to already.

faker.net's People

Contributors

irverbitskiy avatar jonwingfield avatar mps avatar pulsarblow avatar timcollins avatar

Watchers

 avatar  avatar

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.