Skip to content

JamesKovacs/FactoryGirl.NET

Repository files navigation

FactoryGirl.NET

Minimal implementation of Ruby's factory_girl in .NET. If you are familiar with factory_girl in Ruby, we only support defining factories and building objects using those factories. We do not support create (e.g. saving to the database), attributes_for, or build_stubbed yet.

To define a factory:

FactoryGirl.Define(() => new User {
                              FirstName = "John",
                              LastName = "Doe",
                              Admin = false
                            });

To use a factory:

var user = FactoryGirl.Build<User>();

To customize the object being built:

var admin = FactoryGirl.Build<User>(x => x.Admin = true);

Copyright © 2012 James Kovacs

About

A .NET implementation of Thoughtbot's factory_girl for Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published