seriabov/fakeit


The Kotlin fake data generator library!

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.seriabov:Fakeit:v0.1'
	}
	dependencies {
		implementation("com.github.seriabov:Fakeit:v0.1")
	}
	<dependency>
	    <groupId>com.github.seriabov</groupId>
	    <artifactId>Fakeit</artifactId>
	    <version>v0.1</version>
	</dependency>

                            
    libraryDependencies += "com.github.seriabov" % "Fakeit" % "v0.1"
        
        

                            
    :dependencies [[com.github.seriabov/Fakeit "v0.1"]]
        
        

Readme


Fakeit

alt text

This library is a port of the Ruby gem Faker. It generates realistic fake data — like names, emails, dates, countries — to be used in your Android development environment. It can be used in a variety of scenarios, including automated testing and database population.

Download

Maven

<dependency>
  <groupId>com.github.moove-it</groupId>
  <artifactId>fakeit</artifactId>
  <version>v0.2</version>
</dependency>

or Gradle:

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}
  
dependencies {
  compile 'com.github.moove-it:fakeit:v0.2'
}

Basic usage

Fakeit can be used in Java and Kotlin Android apps. Run the sample app to check all the available models and generate some random values.

First you need to initialize Fakeit:

// Default locale is en
Fakeit.init(context)

// Or you can pass a Locale o a String locale
Fakeit.init(context, locale)

And then, call the methods like this:

Fakeit.name().lastName()
Fakeit.business().type()
Fakeit.address().city()
Fakeit.card().name()

This is the current list of fake data models available:

  • Address
  • Ancient
  • App
  • Artist
  • Bank
  • Beer
  • Book
  • Business
  • Card
  • Cat
  • Chuck Norris
  • Code
  • Company
  • Compass
  • Demographic
  • Educator
  • Esport
  • File
  • Food
  • Friends
  • Game of Thrones
  • Hacker
  • Harry Potter
  • Hey Arnold
  • Hipster
  • Internet
  • Job
  • Lord of the Rings
  • Lorem
  • Music
  • Name
  • Phone number
  • Pokemon
  • Rick and Morty
  • Rock band

Questions and issues

For bug reports and feature requests, use Github issue tracker

Contributing

See the contribution guide.

License

MIT

Fakeit is maintained by © Moove-it