All Projects → dotnet-ad → Faker.Portable

dotnet-ad / Faker.Portable

Licence: MIT license
C# faked data generation for testing and prototyping purpose.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Faker.Portable

Strictly fake
Stub that automatically verifies that stubbed methods exist and the signatures match the original.
Stars: ✭ 18 (+50%)
Mutual labels:  stub, fake
Stubmatic
Mock HTTP calls without coding. Designed specially for testing and testers.
Stars: ✭ 118 (+883.33%)
Mutual labels:  stub, fake
Impersonator
Ruby library to record and replay object interactions
Stars: ✭ 100 (+733.33%)
Mutual labels:  stub, fake
stub-server
Stub server for REST APIs
Stars: ✭ 14 (+16.67%)
Mutual labels:  stub, fake
Clj Fakes
An isolation framework for Clojure/ClojureScript.
Stars: ✭ 26 (+116.67%)
Mutual labels:  stub, fake
Fake server
FakeServer integrates with ExUnit to make external APIs testing simpler
Stars: ✭ 64 (+433.33%)
Mutual labels:  stub, fake
ts-mock-imports
Intuitive mocking library for Typescript class imports
Stars: ✭ 103 (+758.33%)
Mutual labels:  stub, fake
node-mock-examples
Examples of tests that mock Node system APIs: fs, http, child_process, timers
Stars: ✭ 38 (+216.67%)
Mutual labels:  stub
fakey-json
This is a utility for mocking json data that pretends the api response data with JSON format.
Stars: ✭ 27 (+125%)
Mutual labels:  fake
mutable
State containers with dirty checking and more
Stars: ✭ 32 (+166.67%)
Mutual labels:  model
Blender-Tools-for-DSCS
This repository provides a work-in-progress addon for Blender 2.8 that can (to some degree) import model files from the PC version of Digimon Story: Cyber Sleuth. It provides new options in File > Import and File > Export named "DSCS Model", which should be pointed towards 'name' files in the game data. The file format is mostly understood; but …
Stars: ✭ 18 (+50%)
Mutual labels:  model
FireSnapshot
A useful Firebase-Cloud-Firestore Wrapper with Codable.
Stars: ✭ 56 (+366.67%)
Mutual labels:  model
json-schema-js-gui-model
Handy gui model and associated translator that can be used to construct javascript UI forms from json-schemas
Stars: ✭ 19 (+58.33%)
Mutual labels:  model
BMExport
一个 JSON 转 Objective-C,Swift class, Swift struct Model 属性的 Mac 小工具,【点击直接下载 https://github.com/liangdahong/BMExport/releases/download/2.0/BMExport2.0.dmg 】。
Stars: ✭ 22 (+83.33%)
Mutual labels:  model
dummyhttp
Super simple HTTP server that replies a fixed body with a fixed response code
Stars: ✭ 25 (+108.33%)
Mutual labels:  fake
compose plantuml
Generate Plantuml graphs from docker-compose files
Stars: ✭ 77 (+541.67%)
Mutual labels:  model
blender-importer-unity
A tool to fix orientation issues from Blender to Unity
Stars: ✭ 23 (+91.67%)
Mutual labels:  model
modelsafe
A type-safe data modelling library for TypeScript
Stars: ✭ 13 (+8.33%)
Mutual labels:  model
seapy
State Estimation and Analysis in Python
Stars: ✭ 25 (+108.33%)
Mutual labels:  model
random
Random data generator AKA faker
Stars: ✭ 14 (+16.67%)
Mutual labels:  fake

Faker.Portable

I wrote this library some time ago for helping me generating some faked data. It's a quick and ugly implementation at the moment, but it do the job pretty well for me.

Installation

The library is available as a PCL on NuGet.

To install Faker.Portable, run the following command in the Package Manager Console.

PM> Install-Package Faker.Portable

Usage

Creation

To create a faked instance, simply call the Create<T> generic method, where T is the object type :

var value = Faker.Default.Create<string>();

You can also add advice by adding a string :

var value = Faker.Default.Create<string>("name");

Faker will generate POCO and each of its properties and use property name as the advice for generation :

public class MyObject
{
	public string Name { get; set; }
	public string Description { get; set; }
	public MyObject Child { get; set; }
}

var value = Faker.Default.Create<MyObject>();

Note : when a cycle exists (like MyObject.Child previous example), the faked data generation stops with a default depth of 10. You can change this behavior by changing the Faker.Default.MaxScope property.

Customisation

You can register custom behaviors simply by calling the Register<T> generic methods :

Faker.Default.Register<string>(() => "Faker.Portable");
var value = Faker.Default.Create<string>();
// value == "Faker.Portable"

You can add add a condition regarding what the given advice should be :

Faker.Default.Register<string>("title",() => "Faker.Portable");
var value = Faker.Default.Create<string>("Title");
// value == "Faker.Portable"

Or a lambda expression :

Faker.Default.Register<string>((a) => a.ToLower().Trim().Contains("title"),() => "Faker.Portable");
var value = Faker.Default.Create<string>("MainTitle");
// value == "Faker.Portable"

At any time you can remove your custom behaviors by calling Faker.Default.Reset() method.

Supported base types

The library currently supports those base types : string, Uri, bool, char, enum, int, long, byte, DateTime, IDictionary<,>, double, float, IEnumerable<>, List<>, List<>, Stack<>, ObservableCollection<>, Task, Task<>.

Roadmap / ideas

  • Cleaning code and improving architecture.
  • Adding missing base types.
  • Adding more advices support.

Copyright and license

Code and documentation copyright 2014-2015 Aloïs Deniel released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].