Skip to content

A simple but powerful factory for creating objects for testing purposes.

License

Notifications You must be signed in to change notification settings

rhanekom/FactoryPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FactoryPlus

Introduction

FactoryPlus is a library for creating objects used in testing in .NET programs. It serves as an implementation of the Object Mother pattern.

FactoryPlus is inspired by factory_girl, but aims for simplicity with a small subset of useful features.

Basic Usage

Define how to create an object

Factory.Define(() => new User() { Name = "Test" });

Create an object

User user = Factory.Get<User>();

Create many objects

IList<User> users = Factory.GetMany<User>(100);

Named instances

Factory.Define("adminUser", () => new User() { Name = "Test", Role = Roles.Admin });
User user = Factory.Get<User>("adminUser"); 

License

FactoryPlus is licensed under the MIT License.

About

A simple but powerful factory for creating objects for testing purposes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages