Skip to content

About

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

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

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

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages