A .NET implementation of Thoughtbot's factory_girl for Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 5 commits behind JamesKovacs:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
FactoryGirl.NET.Specs
FactoryGirl.NET
packages
.gitignore
FactoryGirl.NET.sln
README.md

README.md

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