A .NET implementation of Thoughtbot's factory_girl for Ruby
C# Shell
Permalink
Failed to load latest commit information.
FactoryGirl.NET.Specs Initial implementation of FactoryGirl.NET supporting FactoryGirl.Defi… Mar 21, 2012
FactoryGirl.NET added nuget packaging feature Dec 19, 2012
packages Initial implementation of FactoryGirl.NET supporting FactoryGirl.Defi… Mar 21, 2012
.gitignore added nuget packaging feature Dec 19, 2012
DeployToNuGet.bat
FactoryGirl.NET.sln added nuget packaging feature Dec 19, 2012
NuGet.exe added nuget packaging feature Dec 19, 2012
README.md Initial implementation of FactoryGirl.NET supporting FactoryGirl.Defi… Mar 21, 2012
license.txt added nuget packaging feature Dec 19, 2012

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