Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 859 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 859 Bytes

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